Rollup merge of #118969 - Zalathar:waker-noop, r=compiler-errors

coverage: Use `Waker::noop` in async tests

Inspired by #118948.

---

`@rustbot` label +A-code-coverage
This commit is contained in:
Matthias Krüger 2023-12-15 15:53:51 +01:00 committed by GitHub
commit b9a6f19f19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 134 additions and 353 deletions

View file

@ -1,20 +1,20 @@
Function name: async::c
Raw bytes (9): 0x[01, 01, 00, 01, 01, 05, 01, 00, 19]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 07, 01, 00, 19]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 5, 1) to (start + 0, 25)
- Code(Counter(0)) at (prev + 7, 1) to (start + 0, 25)
Function name: async::c::{closure#0}
Raw bytes (28): 0x[01, 01, 02, 01, 05, 05, 02, 04, 01, 05, 19, 01, 0e, 05, 02, 09, 00, 0a, 02, 02, 09, 00, 0a, 07, 02, 01, 00, 02]
Raw bytes (28): 0x[01, 01, 02, 01, 05, 05, 02, 04, 01, 07, 19, 01, 0e, 05, 02, 09, 00, 0a, 02, 02, 09, 00, 0a, 07, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
- expression 1 operands: lhs = Counter(1), rhs = Expression(0, Sub)
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 5, 25) to (start + 1, 14)
- Code(Counter(0)) at (prev + 7, 25) to (start + 1, 14)
- Code(Counter(1)) at (prev + 2, 9) to (start + 0, 10)
- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10)
= (c0 - c1)
@ -22,136 +22,84 @@ Number of file 0 mappings: 4
= (c1 + (c0 - c1))
Function name: async::d
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0d, 01, 00, 14]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0f, 01, 00, 14]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 13, 1) to (start + 0, 20)
- Code(Counter(0)) at (prev + 15, 1) to (start + 0, 20)
Function name: async::d::{closure#0}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0d, 14, 00, 19]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0f, 14, 00, 19]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 13, 20) to (start + 0, 25)
- Code(Counter(0)) at (prev + 15, 20) to (start + 0, 25)
Function name: async::e (unused)
Raw bytes (9): 0x[01, 01, 00, 01, 00, 0f, 01, 00, 14]
Raw bytes (9): 0x[01, 01, 00, 01, 00, 11, 01, 00, 14]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Zero) at (prev + 15, 1) to (start + 0, 20)
- Code(Zero) at (prev + 17, 1) to (start + 0, 20)
Function name: async::e::{closure#0} (unused)
Raw bytes (9): 0x[01, 01, 00, 01, 00, 0f, 14, 00, 19]
Raw bytes (9): 0x[01, 01, 00, 01, 00, 11, 14, 00, 19]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Zero) at (prev + 15, 20) to (start + 0, 25)
Function name: async::executor::block_on::<core::pin::Pin<&mut async::i::{closure#0}>>
Raw bytes (40): 0x[01, 01, 03, 0b, 05, 01, 05, 01, 05, 06, 01, 6e, 05, 0a, 36, 02, 0d, 20, 00, 23, 0b, 00, 27, 00, 49, 02, 01, 17, 00, 1a, 05, 01, 0e, 00, 0f, 02, 02, 05, 00, 06]
Number of files: 1
- file 0 => global file 1
Number of expressions: 3
- expression 0 operands: lhs = Expression(2, Add), rhs = Counter(1)
- expression 1 operands: lhs = Counter(0), rhs = Counter(1)
- expression 2 operands: lhs = Counter(0), rhs = Counter(1)
Number of file 0 mappings: 6
- Code(Counter(0)) at (prev + 110, 5) to (start + 10, 54)
- Code(Expression(0, Sub)) at (prev + 13, 32) to (start + 0, 35)
= ((c0 + c1) - c1)
- Code(Expression(2, Add)) at (prev + 0, 39) to (start + 0, 73)
= (c0 + c1)
- Code(Expression(0, Sub)) at (prev + 1, 23) to (start + 0, 26)
= ((c0 + c1) - c1)
- Code(Counter(1)) at (prev + 1, 14) to (start + 0, 15)
- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6)
= ((c0 + c1) - c1)
Function name: async::executor::block_on::VTABLE::{closure#0}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 72, 11, 00, 31]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 114, 17) to (start + 0, 49)
Function name: async::executor::block_on::VTABLE::{closure#1}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 73, 11, 00, 31]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 115, 17) to (start + 0, 49)
Function name: async::executor::block_on::VTABLE::{closure#2}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 74, 11, 00, 31]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 116, 17) to (start + 0, 49)
Function name: async::executor::block_on::VTABLE::{closure#3}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 75, 11, 00, 13]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 117, 17) to (start + 0, 19)
- Code(Zero) at (prev + 17, 20) to (start + 0, 25)
Function name: async::f
Raw bytes (9): 0x[01, 01, 00, 01, 01, 11, 01, 00, 14]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 13, 01, 00, 14]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 20)
- Code(Counter(0)) at (prev + 19, 1) to (start + 0, 20)
Function name: async::f::{closure#0}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 11, 14, 00, 19]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 13, 14, 00, 19]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 17, 20) to (start + 0, 25)
- Code(Counter(0)) at (prev + 19, 20) to (start + 0, 25)
Function name: async::foo (unused)
Raw bytes (9): 0x[01, 01, 00, 01, 00, 13, 01, 00, 1e]
Raw bytes (9): 0x[01, 01, 00, 01, 00, 15, 01, 00, 1e]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Zero) at (prev + 19, 1) to (start + 0, 30)
- Code(Zero) at (prev + 21, 1) to (start + 0, 30)
Function name: async::foo::{closure#0} (unused)
Raw bytes (9): 0x[01, 01, 00, 01, 00, 13, 1e, 00, 2d]
Raw bytes (9): 0x[01, 01, 00, 01, 00, 15, 1e, 00, 2d]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Zero) at (prev + 19, 30) to (start + 0, 45)
- Code(Zero) at (prev + 21, 30) to (start + 0, 45)
Function name: async::g
Raw bytes (9): 0x[01, 01, 00, 01, 01, 15, 01, 00, 17]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 17, 01, 00, 17]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 21, 1) to (start + 0, 23)
- Code(Counter(0)) at (prev + 23, 1) to (start + 0, 23)
Function name: async::g::{closure#0} (unused)
Raw bytes (69): 0x[01, 01, 00, 0d, 00, 15, 17, 01, 0c, 00, 02, 09, 00, 0a, 00, 00, 0e, 00, 11, 00, 00, 12, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 09, 00, 0a, 00, 00, 0e, 00, 11, 00, 00, 12, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
Raw bytes (69): 0x[01, 01, 00, 0d, 00, 17, 17, 01, 0c, 00, 02, 09, 00, 0a, 00, 00, 0e, 00, 11, 00, 00, 12, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 09, 00, 0a, 00, 00, 0e, 00, 11, 00, 00, 12, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 13
- Code(Zero) at (prev + 21, 23) to (start + 1, 12)
- Code(Zero) at (prev + 23, 23) to (start + 1, 12)
- Code(Zero) at (prev + 2, 9) to (start + 0, 10)
- Code(Zero) at (prev + 0, 14) to (start + 0, 17)
- Code(Zero) at (prev + 0, 18) to (start + 0, 23)
@ -166,20 +114,20 @@ Number of file 0 mappings: 13
- Code(Zero) at (prev + 2, 1) to (start + 0, 2)
Function name: async::h
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1d, 01, 00, 16]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1f, 01, 00, 16]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 29, 1) to (start + 0, 22)
- Code(Counter(0)) at (prev + 31, 1) to (start + 0, 22)
Function name: async::h::{closure#0} (unused)
Raw bytes (44): 0x[01, 01, 00, 08, 00, 1d, 16, 03, 0c, 00, 04, 09, 00, 0a, 00, 00, 0e, 00, 13, 00, 00, 14, 00, 19, 00, 00, 1a, 00, 1b, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
Raw bytes (44): 0x[01, 01, 00, 08, 00, 1f, 16, 03, 0c, 00, 04, 09, 00, 0a, 00, 00, 0e, 00, 13, 00, 00, 14, 00, 19, 00, 00, 1a, 00, 1b, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 8
- Code(Zero) at (prev + 29, 22) to (start + 3, 12)
- Code(Zero) at (prev + 31, 22) to (start + 3, 12)
- Code(Zero) at (prev + 4, 9) to (start + 0, 10)
- Code(Zero) at (prev + 0, 14) to (start + 0, 19)
- Code(Zero) at (prev + 0, 20) to (start + 0, 25)
@ -189,22 +137,22 @@ Number of file 0 mappings: 8
- Code(Zero) at (prev + 2, 1) to (start + 0, 2)
Function name: async::i
Raw bytes (9): 0x[01, 01, 00, 01, 01, 26, 01, 00, 13]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 28, 01, 00, 13]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 38, 1) to (start + 0, 19)
- Code(Counter(0)) at (prev + 40, 1) to (start + 0, 19)
Function name: async::i::{closure#0}
Raw bytes (78): 0x[01, 01, 02, 07, 21, 19, 1d, 0e, 01, 26, 13, 04, 0c, 0d, 05, 09, 00, 0a, 01, 00, 0e, 00, 12, 05, 00, 13, 00, 18, 09, 00, 1c, 00, 21, 0d, 00, 27, 00, 2a, 15, 00, 2b, 00, 30, 1d, 01, 09, 00, 0a, 11, 00, 0e, 00, 11, 25, 00, 12, 00, 17, 29, 00, 1b, 00, 20, 1d, 00, 24, 00, 26, 21, 01, 0e, 00, 10, 03, 02, 01, 00, 02]
Raw bytes (78): 0x[01, 01, 02, 07, 21, 19, 1d, 0e, 01, 28, 13, 04, 0c, 0d, 05, 09, 00, 0a, 01, 00, 0e, 00, 12, 05, 00, 13, 00, 18, 09, 00, 1c, 00, 21, 0d, 00, 27, 00, 2a, 15, 00, 2b, 00, 30, 1d, 01, 09, 00, 0a, 11, 00, 0e, 00, 11, 25, 00, 12, 00, 17, 29, 00, 1b, 00, 20, 1d, 00, 24, 00, 26, 21, 01, 0e, 00, 10, 03, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(8)
- expression 1 operands: lhs = Counter(6), rhs = Counter(7)
Number of file 0 mappings: 14
- Code(Counter(0)) at (prev + 38, 19) to (start + 4, 12)
- Code(Counter(0)) at (prev + 40, 19) to (start + 4, 12)
- Code(Counter(3)) at (prev + 5, 9) to (start + 0, 10)
- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 18)
- Code(Counter(1)) at (prev + 0, 19) to (start + 0, 24)
@ -221,14 +169,14 @@ Number of file 0 mappings: 14
= ((c6 + c7) + c8)
Function name: async::j
Raw bytes (53): 0x[01, 01, 02, 07, 0d, 05, 09, 09, 01, 31, 01, 13, 0c, 05, 14, 09, 00, 0a, 01, 00, 0e, 00, 1b, 05, 00, 1f, 00, 27, 09, 01, 09, 00, 0a, 11, 00, 0e, 00, 1a, 09, 00, 1e, 00, 20, 0d, 01, 0e, 00, 10, 03, 02, 01, 00, 02]
Raw bytes (53): 0x[01, 01, 02, 07, 0d, 05, 09, 09, 01, 33, 01, 13, 0c, 05, 14, 09, 00, 0a, 01, 00, 0e, 00, 1b, 05, 00, 1f, 00, 27, 09, 01, 09, 00, 0a, 11, 00, 0e, 00, 1a, 09, 00, 1e, 00, 20, 0d, 01, 0e, 00, 10, 03, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Expression(1, Add), rhs = Counter(3)
- expression 1 operands: lhs = Counter(1), rhs = Counter(2)
Number of file 0 mappings: 9
- Code(Counter(0)) at (prev + 49, 1) to (start + 19, 12)
- Code(Counter(0)) at (prev + 51, 1) to (start + 19, 12)
- Code(Counter(1)) at (prev + 20, 9) to (start + 0, 10)
- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 27)
- Code(Counter(1)) at (prev + 0, 31) to (start + 0, 39)
@ -240,14 +188,14 @@ Number of file 0 mappings: 9
= ((c1 + c2) + c3)
Function name: async::j::c
Raw bytes (28): 0x[01, 01, 02, 01, 05, 05, 02, 04, 01, 33, 05, 01, 12, 05, 02, 0d, 00, 0e, 02, 0a, 0d, 00, 0e, 07, 02, 05, 00, 06]
Raw bytes (28): 0x[01, 01, 02, 01, 05, 05, 02, 04, 01, 35, 05, 01, 12, 05, 02, 0d, 00, 0e, 02, 0a, 0d, 00, 0e, 07, 02, 05, 00, 06]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
- expression 1 operands: lhs = Counter(1), rhs = Expression(0, Sub)
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 51, 5) to (start + 1, 18)
- Code(Counter(0)) at (prev + 53, 5) to (start + 1, 18)
- Code(Counter(1)) at (prev + 2, 13) to (start + 0, 14)
- Code(Expression(0, Sub)) at (prev + 10, 13) to (start + 0, 14)
= (c0 - c1)
@ -255,35 +203,35 @@ Number of file 0 mappings: 4
= (c1 + (c0 - c1))
Function name: async::j::d
Raw bytes (9): 0x[01, 01, 00, 01, 01, 42, 05, 00, 17]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 44, 05, 00, 17]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 66, 5) to (start + 0, 23)
- Code(Counter(0)) at (prev + 68, 5) to (start + 0, 23)
Function name: async::j::f
Raw bytes (9): 0x[01, 01, 00, 01, 01, 43, 05, 00, 17]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 45, 05, 00, 17]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 67, 5) to (start + 0, 23)
- Code(Counter(0)) at (prev + 69, 5) to (start + 0, 23)
Function name: async::k (unused)
Raw bytes (29): 0x[01, 01, 00, 05, 00, 4b, 01, 01, 0c, 00, 02, 0e, 00, 10, 00, 01, 0e, 00, 10, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
Raw bytes (29): 0x[01, 01, 00, 05, 00, 4d, 01, 01, 0c, 00, 02, 0e, 00, 10, 00, 01, 0e, 00, 10, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 5
- Code(Zero) at (prev + 75, 1) to (start + 1, 12)
- Code(Zero) at (prev + 77, 1) to (start + 1, 12)
- Code(Zero) at (prev + 2, 14) to (start + 0, 16)
- Code(Zero) at (prev + 1, 14) to (start + 0, 16)
- Code(Zero) at (prev + 1, 14) to (start + 0, 16)
- Code(Zero) at (prev + 2, 1) to (start + 0, 2)
Function name: async::l
Raw bytes (37): 0x[01, 01, 04, 01, 07, 05, 09, 0f, 02, 09, 05, 05, 01, 53, 01, 01, 0c, 02, 02, 0e, 00, 10, 05, 01, 0e, 00, 10, 09, 01, 0e, 00, 10, 0b, 02, 01, 00, 02]
Raw bytes (37): 0x[01, 01, 04, 01, 07, 05, 09, 0f, 02, 09, 05, 05, 01, 55, 01, 01, 0c, 02, 02, 0e, 00, 10, 05, 01, 0e, 00, 10, 09, 01, 0e, 00, 10, 0b, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 4
@ -292,7 +240,7 @@ Number of expressions: 4
- expression 2 operands: lhs = Expression(3, Add), rhs = Expression(0, Sub)
- expression 3 operands: lhs = Counter(2), rhs = Counter(1)
Number of file 0 mappings: 5
- Code(Counter(0)) at (prev + 83, 1) to (start + 1, 12)
- Code(Counter(0)) at (prev + 85, 1) to (start + 1, 12)
- Code(Expression(0, Sub)) at (prev + 2, 14) to (start + 0, 16)
= (c0 - (c1 + c2))
- Code(Counter(1)) at (prev + 1, 14) to (start + 0, 16)
@ -301,26 +249,26 @@ Number of file 0 mappings: 5
= ((c2 + c1) + (c0 - (c1 + c2)))
Function name: async::m
Raw bytes (9): 0x[01, 01, 00, 01, 01, 5b, 01, 00, 19]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 5d, 01, 00, 19]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 91, 1) to (start + 0, 25)
- Code(Counter(0)) at (prev + 93, 1) to (start + 0, 25)
Function name: async::m::{closure#0} (unused)
Raw bytes (9): 0x[01, 01, 00, 01, 00, 5b, 19, 00, 22]
Raw bytes (9): 0x[01, 01, 00, 01, 00, 5d, 19, 00, 22]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Zero) at (prev + 91, 25) to (start + 0, 34)
- Code(Zero) at (prev + 93, 25) to (start + 0, 34)
Function name: async::main
Raw bytes (9): 0x[01, 01, 00, 01, 01, 5d, 01, 08, 02]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 5f, 01, 08, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 93, 1) to (start + 8, 2)
- Code(Counter(0)) at (prev + 95, 1) to (start + 8, 2)

View file

@ -1,6 +1,8 @@
LL| |#![feature(coverage_attribute)]
LL| |#![feature(noop_waker)]
LL| |#![allow(unused_assignments, dead_code)]
LL| |
LL| |// compile-flags: --edition=2018 -C opt-level=1
LL| |// edition: 2018
LL| |// compile-flags: -Copt-level=1
LL| |
LL| 1|async fn c(x: u8) -> u8 {
LL| 1| if x == 8 {
@ -108,32 +110,21 @@
LL| 1|}
LL| |
LL| |mod executor {
LL| | use core::{
LL| | future::Future,
LL| | pin::Pin,
LL| | task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
LL| | };
LL| | use core::future::Future;
LL| | use core::pin::pin;
LL| | use core::task::{Context, Poll, Waker};
LL| |
LL| 1| pub fn block_on<F: Future>(mut future: F) -> F::Output {
LL| 1| let mut future = unsafe { Pin::new_unchecked(&mut future) };
LL| 1| use std::hint::unreachable_unchecked;
LL| 1| static VTABLE: RawWakerVTable = RawWakerVTable::new(
LL| 1| |_| unsafe { unreachable_unchecked() }, // clone
^0
LL| 1| |_| unsafe { unreachable_unchecked() }, // wake
^0
LL| 1| |_| unsafe { unreachable_unchecked() }, // wake_by_ref
^0
LL| 1| |_| (),
LL| 1| );
LL| 1| let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
LL| 1| let mut context = Context::from_waker(&waker);
LL| | #[coverage(off)]
LL| | pub fn block_on<F: Future>(mut future: F) -> F::Output {
LL| | let mut future = pin!(future);
LL| | let waker = Waker::noop();
LL| | let mut context = Context::from_waker(&waker);
LL| |
LL| | loop {
LL| 1| if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
LL| 1| break val;
LL| 0| }
LL| | if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
LL| | break val;
LL| | }
LL| | }
LL| 1| }
LL| | }
LL| |}

View file

@ -1,6 +1,8 @@
#![feature(coverage_attribute)]
#![feature(noop_waker)]
#![allow(unused_assignments, dead_code)]
// compile-flags: --edition=2018 -C opt-level=1
// edition: 2018
// compile-flags: -Copt-level=1
async fn c(x: u8) -> u8 {
if x == 8 {
@ -101,22 +103,14 @@ fn main() {
}
mod executor {
use core::{
future::Future,
pin::Pin,
task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
};
use core::future::Future;
use core::pin::pin;
use core::task::{Context, Poll, Waker};
#[coverage(off)]
pub fn block_on<F: Future>(mut future: F) -> F::Output {
let mut future = unsafe { Pin::new_unchecked(&mut future) };
use std::hint::unreachable_unchecked;
static VTABLE: RawWakerVTable = RawWakerVTable::new(
|_| unsafe { unreachable_unchecked() }, // clone
|_| unsafe { unreachable_unchecked() }, // wake
|_| unsafe { unreachable_unchecked() }, // wake_by_ref
|_| (),
);
let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
let mut future = pin!(future);
let waker = Waker::noop();
let mut context = Context::from_waker(&waker);
loop {

View file

@ -1,20 +1,20 @@
Function name: async2::async_func
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0b, 01, 00, 17]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 0d, 01, 00, 17]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 11, 1) to (start + 0, 23)
- Code(Counter(0)) at (prev + 13, 1) to (start + 0, 23)
Function name: async2::async_func::{closure#0}
Raw bytes (28): 0x[01, 01, 02, 01, 05, 05, 02, 04, 01, 0b, 17, 03, 09, 05, 03, 0a, 02, 06, 02, 02, 06, 00, 07, 07, 01, 01, 00, 02]
Raw bytes (28): 0x[01, 01, 02, 01, 05, 05, 02, 04, 01, 0d, 17, 03, 09, 05, 03, 0a, 02, 06, 02, 02, 06, 00, 07, 07, 01, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
- expression 1 operands: lhs = Counter(1), rhs = Expression(0, Sub)
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 11, 23) to (start + 3, 9)
- Code(Counter(0)) at (prev + 13, 23) to (start + 3, 9)
- Code(Counter(1)) at (prev + 3, 10) to (start + 2, 6)
- Code(Expression(0, Sub)) at (prev + 2, 6) to (start + 0, 7)
= (c0 - c1)
@ -22,109 +22,37 @@ Number of file 0 mappings: 4
= (c1 + (c0 - c1))
Function name: async2::async_func_just_println
Raw bytes (9): 0x[01, 01, 00, 01, 01, 13, 01, 00, 24]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 15, 01, 00, 24]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 19, 1) to (start + 0, 36)
- Code(Counter(0)) at (prev + 21, 1) to (start + 0, 36)
Function name: async2::async_func_just_println::{closure#0}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 13, 24, 02, 02]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 15, 24, 02, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 19, 36) to (start + 2, 2)
Function name: async2::executor::block_on::<async2::async_func::{closure#0}>
Raw bytes (40): 0x[01, 01, 03, 0b, 05, 01, 05, 01, 05, 06, 01, 27, 05, 0a, 36, 02, 0d, 20, 00, 23, 0b, 00, 27, 00, 49, 02, 01, 17, 00, 1a, 05, 01, 0e, 00, 0f, 02, 02, 05, 00, 06]
Number of files: 1
- file 0 => global file 1
Number of expressions: 3
- expression 0 operands: lhs = Expression(2, Add), rhs = Counter(1)
- expression 1 operands: lhs = Counter(0), rhs = Counter(1)
- expression 2 operands: lhs = Counter(0), rhs = Counter(1)
Number of file 0 mappings: 6
- Code(Counter(0)) at (prev + 39, 5) to (start + 10, 54)
- Code(Expression(0, Sub)) at (prev + 13, 32) to (start + 0, 35)
= ((c0 + c1) - c1)
- Code(Expression(2, Add)) at (prev + 0, 39) to (start + 0, 73)
= (c0 + c1)
- Code(Expression(0, Sub)) at (prev + 1, 23) to (start + 0, 26)
= ((c0 + c1) - c1)
- Code(Counter(1)) at (prev + 1, 14) to (start + 0, 15)
- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6)
= ((c0 + c1) - c1)
Function name: async2::executor::block_on::<async2::async_func_just_println::{closure#0}>
Raw bytes (40): 0x[01, 01, 03, 0b, 05, 01, 05, 01, 05, 06, 01, 27, 05, 0a, 36, 02, 0d, 20, 00, 23, 0b, 00, 27, 00, 49, 02, 01, 17, 00, 1a, 05, 01, 0e, 00, 0f, 02, 02, 05, 00, 06]
Number of files: 1
- file 0 => global file 1
Number of expressions: 3
- expression 0 operands: lhs = Expression(2, Add), rhs = Counter(1)
- expression 1 operands: lhs = Counter(0), rhs = Counter(1)
- expression 2 operands: lhs = Counter(0), rhs = Counter(1)
Number of file 0 mappings: 6
- Code(Counter(0)) at (prev + 39, 5) to (start + 10, 54)
- Code(Expression(0, Sub)) at (prev + 13, 32) to (start + 0, 35)
= ((c0 + c1) - c1)
- Code(Expression(2, Add)) at (prev + 0, 39) to (start + 0, 73)
= (c0 + c1)
- Code(Expression(0, Sub)) at (prev + 1, 23) to (start + 0, 26)
= ((c0 + c1) - c1)
- Code(Counter(1)) at (prev + 1, 14) to (start + 0, 15)
- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6)
= ((c0 + c1) - c1)
Function name: async2::executor::block_on::VTABLE::{closure#0}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 2b, 11, 00, 31]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 43, 17) to (start + 0, 49)
Function name: async2::executor::block_on::VTABLE::{closure#1}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 2c, 11, 00, 31]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 44, 17) to (start + 0, 49)
Function name: async2::executor::block_on::VTABLE::{closure#2}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 2d, 11, 00, 31]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 45, 17) to (start + 0, 49)
Function name: async2::executor::block_on::VTABLE::{closure#3}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 2e, 11, 00, 13]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 46, 17) to (start + 0, 19)
- Code(Counter(0)) at (prev + 21, 36) to (start + 2, 2)
Function name: async2::main
Raw bytes (9): 0x[01, 01, 00, 01, 01, 17, 01, 07, 02]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 19, 01, 07, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 23, 1) to (start + 7, 2)
- Code(Counter(0)) at (prev + 25, 1) to (start + 7, 2)
Function name: async2::non_async_func
Raw bytes (26): 0x[01, 01, 01, 05, 00, 04, 01, 03, 01, 03, 09, 05, 03, 0a, 02, 06, 00, 02, 06, 00, 07, 03, 01, 01, 00, 02]
Raw bytes (26): 0x[01, 01, 01, 05, 00, 04, 01, 05, 01, 03, 09, 05, 03, 0a, 02, 06, 00, 02, 06, 00, 07, 03, 01, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 1
- expression 0 operands: lhs = Counter(1), rhs = Zero
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 3, 1) to (start + 3, 9)
- Code(Counter(0)) at (prev + 5, 1) to (start + 3, 9)
- Code(Counter(1)) at (prev + 3, 10) to (start + 2, 6)
- Code(Zero) at (prev + 2, 6) to (start + 0, 7)
- Code(Expression(0, Add)) at (prev + 1, 1) to (start + 0, 2)

View file

@ -1,4 +1,6 @@
LL| |// compile-flags: --edition=2018
LL| |#![feature(coverage_attribute)]
LL| |#![feature(noop_waker)]
LL| |// edition: 2018
LL| |
LL| 1|fn non_async_func() {
LL| 1| println!("non_async_func was covered");
@ -32,73 +34,21 @@
LL| 1|}
LL| |
LL| |mod executor {
LL| | use core::{
LL| | future::Future,
LL| | pin::Pin,
LL| | task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
LL| | };
LL| | use core::future::Future;
LL| | use core::pin::pin;
LL| | use core::task::{Context, Poll, Waker};
LL| |
LL| 2| pub fn block_on<F: Future>(mut future: F) -> F::Output {
LL| 2| let mut future = unsafe { Pin::new_unchecked(&mut future) };
LL| 2| use std::hint::unreachable_unchecked;
LL| 2| static VTABLE: RawWakerVTable = RawWakerVTable::new(
LL| 2| |_| unsafe { unreachable_unchecked() }, // clone
^0
LL| 2| |_| unsafe { unreachable_unchecked() }, // wake
^0
LL| 2| |_| unsafe { unreachable_unchecked() }, // wake_by_ref
^0
LL| 2| |_| (),
LL| 2| );
LL| 2| let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
LL| 2| let mut context = Context::from_waker(&waker);
LL| | #[coverage(off)]
LL| | pub fn block_on<F: Future>(mut future: F) -> F::Output {
LL| | let mut future = pin!(future);
LL| | let waker = Waker::noop();
LL| | let mut context = Context::from_waker(&waker);
LL| |
LL| | loop {
LL| 2| if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
LL| 2| break val;
LL| 0| }
LL| | if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
LL| | break val;
LL| | }
LL| | }
LL| 2| }
------------------
| async2::executor::block_on::<async2::async_func::{closure#0}>:
| LL| 1| pub fn block_on<F: Future>(mut future: F) -> F::Output {
| LL| 1| let mut future = unsafe { Pin::new_unchecked(&mut future) };
| LL| 1| use std::hint::unreachable_unchecked;
| LL| 1| static VTABLE: RawWakerVTable = RawWakerVTable::new(
| LL| 1| |_| unsafe { unreachable_unchecked() }, // clone
| LL| 1| |_| unsafe { unreachable_unchecked() }, // wake
| LL| 1| |_| unsafe { unreachable_unchecked() }, // wake_by_ref
| LL| 1| |_| (),
| LL| 1| );
| LL| 1| let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
| LL| 1| let mut context = Context::from_waker(&waker);
| LL| |
| LL| | loop {
| LL| 1| if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
| LL| 1| break val;
| LL| 0| }
| LL| | }
| LL| 1| }
------------------
| async2::executor::block_on::<async2::async_func_just_println::{closure#0}>:
| LL| 1| pub fn block_on<F: Future>(mut future: F) -> F::Output {
| LL| 1| let mut future = unsafe { Pin::new_unchecked(&mut future) };
| LL| 1| use std::hint::unreachable_unchecked;
| LL| 1| static VTABLE: RawWakerVTable = RawWakerVTable::new(
| LL| 1| |_| unsafe { unreachable_unchecked() }, // clone
| LL| 1| |_| unsafe { unreachable_unchecked() }, // wake
| LL| 1| |_| unsafe { unreachable_unchecked() }, // wake_by_ref
| LL| 1| |_| (),
| LL| 1| );
| LL| 1| let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
| LL| 1| let mut context = Context::from_waker(&waker);
| LL| |
| LL| | loop {
| LL| 1| if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
| LL| 1| break val;
| LL| 0| }
| LL| | }
| LL| 1| }
------------------
LL| | }
LL| |}

View file

@ -1,4 +1,6 @@
// compile-flags: --edition=2018
#![feature(coverage_attribute)]
#![feature(noop_waker)]
// edition: 2018
fn non_async_func() {
println!("non_async_func was covered");
@ -30,22 +32,14 @@ fn main() {
}
mod executor {
use core::{
future::Future,
pin::Pin,
task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
};
use core::future::Future;
use core::pin::pin;
use core::task::{Context, Poll, Waker};
#[coverage(off)]
pub fn block_on<F: Future>(mut future: F) -> F::Output {
let mut future = unsafe { Pin::new_unchecked(&mut future) };
use std::hint::unreachable_unchecked;
static VTABLE: RawWakerVTable = RawWakerVTable::new(
|_| unsafe { unreachable_unchecked() }, // clone
|_| unsafe { unreachable_unchecked() }, // wake
|_| unsafe { unreachable_unchecked() }, // wake_by_ref
|_| (),
);
let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
let mut future = pin!(future);
let waker = Waker::noop();
let mut context = Context::from_waker(&waker);
loop {

View file

@ -1,28 +1,28 @@
Function name: closure_macro_async::load_configuration_files
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1d, 01, 02, 02]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1e, 01, 02, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 29, 1) to (start + 2, 2)
- Code(Counter(0)) at (prev + 30, 1) to (start + 2, 2)
Function name: closure_macro_async::test
Raw bytes (9): 0x[01, 01, 00, 01, 01, 21, 01, 00, 2b]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 22, 01, 00, 2b]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 33, 1) to (start + 0, 43)
- Code(Counter(0)) at (prev + 34, 1) to (start + 0, 43)
Function name: closure_macro_async::test::{closure#0}
Raw bytes (43): 0x[01, 01, 02, 01, 05, 05, 02, 07, 01, 21, 2b, 01, 21, 02, 02, 09, 00, 0f, 05, 00, 12, 00, 13, 02, 00, 12, 00, 13, 05, 00, 54, 00, 55, 02, 02, 09, 02, 0b, 07, 03, 01, 00, 02]
Raw bytes (43): 0x[01, 01, 02, 01, 05, 05, 02, 07, 01, 22, 2b, 01, 21, 02, 02, 09, 00, 0f, 05, 00, 12, 00, 13, 02, 00, 12, 00, 13, 05, 00, 54, 00, 55, 02, 02, 09, 02, 0b, 07, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
- expression 1 operands: lhs = Counter(1), rhs = Expression(0, Sub)
Number of file 0 mappings: 7
- Code(Counter(0)) at (prev + 33, 43) to (start + 1, 33)
- Code(Counter(0)) at (prev + 34, 43) to (start + 1, 33)
- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 15)
= (c0 - c1)
- Code(Counter(1)) at (prev + 0, 18) to (start + 0, 19)
@ -35,10 +35,10 @@ Number of file 0 mappings: 7
= (c1 + (c0 - c1))
Function name: closure_macro_async::test::{closure#0}::{closure#0}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 23, 12, 00, 54]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 24, 12, 00, 54]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 35, 18) to (start + 0, 84)
- Code(Counter(0)) at (prev + 36, 18) to (start + 0, 84)

View file

@ -1,5 +1,6 @@
LL| |// compile-flags: --edition=2018
LL| |#![feature(coverage_attribute)]
LL| |#![feature(noop_waker)]
LL| |// edition: 2018
LL| |
LL| |macro_rules! bail {
LL| | ($msg:literal $(,)?) => {
@ -46,27 +47,14 @@
LL| |}
LL| |
LL| |mod executor {
LL| | use core::{
LL| | future::Future,
LL| | pin::Pin,
LL| | task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
LL| | };
LL| | use core::future::Future;
LL| | use core::pin::pin;
LL| | use core::task::{Context, Poll, Waker};
LL| |
LL| | #[coverage(off)]
LL| | pub fn block_on<F: Future>(mut future: F) -> F::Output {
LL| | let mut future = unsafe { Pin::new_unchecked(&mut future) };
LL| | use std::hint::unreachable_unchecked;
LL| | static VTABLE: RawWakerVTable = RawWakerVTable::new(
LL| | #[coverage(off)]
LL| | |_| unsafe { unreachable_unchecked() }, // clone
LL| | #[coverage(off)]
LL| | |_| unsafe { unreachable_unchecked() }, // wake
LL| | #[coverage(off)]
LL| | |_| unsafe { unreachable_unchecked() }, // wake_by_ref
LL| | #[coverage(off)]
LL| | |_| (),
LL| | );
LL| | let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
LL| | let mut future = pin!(future);
LL| | let waker = Waker::noop();
LL| | let mut context = Context::from_waker(&waker);
LL| |
LL| | loop {

View file

@ -1,5 +1,6 @@
// compile-flags: --edition=2018
#![feature(coverage_attribute)]
#![feature(noop_waker)]
// edition: 2018
macro_rules! bail {
($msg:literal $(,)?) => {
@ -45,27 +46,14 @@ fn main() {
}
mod executor {
use core::{
future::Future,
pin::Pin,
task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
};
use core::future::Future;
use core::pin::pin;
use core::task::{Context, Poll, Waker};
#[coverage(off)]
pub fn block_on<F: Future>(mut future: F) -> F::Output {
let mut future = unsafe { Pin::new_unchecked(&mut future) };
use std::hint::unreachable_unchecked;
static VTABLE: RawWakerVTable = RawWakerVTable::new(
#[coverage(off)]
|_| unsafe { unreachable_unchecked() }, // clone
#[coverage(off)]
|_| unsafe { unreachable_unchecked() }, // wake
#[coverage(off)]
|_| unsafe { unreachable_unchecked() }, // wake_by_ref
#[coverage(off)]
|_| (),
);
let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
let mut future = pin!(future);
let waker = Waker::noop();
let mut context = Context::from_waker(&waker);
loop {