diff options
| author | Rich Kadel <richkadel@google.com> | 2020-12-01 23:01:26 -0800 |
|---|---|---|
| committer | Rich Kadel <richkadel@google.com> | 2020-12-03 09:50:10 -0800 |
| commit | d96f351fa36d31f2b95b1cd2ad37ceaed3d395a8 (patch) | |
| tree | b51e88d4b3163850b652ea044962b812bb339b38 /src/test | |
| parent | def932ca865b86a5057517d8a0e27c0ca72a0815 (diff) | |
| download | rust-d96f351fa36d31f2b95b1cd2ad37ceaed3d395a8.tar.gz rust-d96f351fa36d31f2b95b1cd2ad37ceaed3d395a8.zip | |
Addressed feedback from 2020-12-01
Added one more test (two files) showing coverage of generics and unused functions across crates. Created and referenced new Issues, as requested. Added comments. Added a note about the possible effects of compiler options on LLVM coverage maps.
Diffstat (limited to 'src/test')
23 files changed, 1765 insertions, 359 deletions
diff --git a/src/test/run-make-fulldeps/coverage-reports/expected_export_coverage.async.json b/src/test/run-make-fulldeps/coverage-reports/expected_export_coverage.async.json index 4cc6ea39425..794a2e38253 100644 --- a/src/test/run-make-fulldeps/coverage-reports/expected_export_coverage.async.json +++ b/src/test/run-make-fulldeps/coverage-reports/expected_export_coverage.async.json @@ -6,50 +6,50 @@ "filename": "../coverage/async.rs", "summary": { "functions": { - "count": 16, - "covered": 15, - "percent": 93.75 + "count": 17, + "covered": 16, + "percent": 94.11764705882352 }, "instantiations": { - "count": 16, - "covered": 15, - "percent": 93.75 + "count": 17, + "covered": 16, + "percent": 94.11764705882352 }, "lines": { - "count": 102, - "covered": 75, - "percent": 73.52941176470588 + "count": 105, + "covered": 77, + "percent": 73.33333333333333 }, "regions": { - "count": 76, - "covered": 35, - "notcovered": 41, - "percent": 46.05263157894737 + "count": 78, + "covered": 36, + "notcovered": 42, + "percent": 46.15384615384615 } } } ], "totals": { "functions": { - "count": 16, - "covered": 15, - "percent": 93.75 + "count": 17, + "covered": 16, + "percent": 94.11764705882352 }, "instantiations": { - "count": 16, - "covered": 15, - "percent": 93.75 + "count": 17, + "covered": 16, + "percent": 94.11764705882352 }, "lines": { - "count": 102, - "covered": 75, - "percent": 73.52941176470588 + "count": 105, + "covered": 77, + "percent": 73.33333333333333 }, "regions": { - "count": 76, - "covered": 35, - "notcovered": 41, - "percent": 46.05263157894737 + "count": 78, + "covered": 36, + "notcovered": 42, + "percent": 46.15384615384615 } } } diff --git a/src/test/run-make-fulldeps/coverage-reports/expected_export_coverage.uses_crate.json b/src/test/run-make-fulldeps/coverage-reports/expected_export_coverage.uses_crate.json new file mode 100644 index 00000000000..6189c7b7b64 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports/expected_export_coverage.uses_crate.json @@ -0,0 +1,85 @@ +{ + "data": [ + { + "files": [ + { + "filename": "../coverage/used_crate/mod.rs", + "summary": { + "functions": { + "count": 3, + "covered": 3, + "percent": 100 + }, + "instantiations": { + "count": 4, + "covered": 4, + "percent": 100 + }, + "lines": { + "count": 31, + "covered": 14, + "percent": 45.16129032258064 + }, + "regions": { + "count": 16, + "covered": 6, + "notcovered": 10, + "percent": 37.5 + } + } + }, + { + "filename": "../coverage/uses_crate.rs", + "summary": { + "functions": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "instantiations": { + "count": 1, + "covered": 1, + "percent": 100 + }, + "lines": { + "count": 6, + "covered": 6, + "percent": 100 + }, + "regions": { + "count": 1, + "covered": 1, + "notcovered": 0, + "percent": 100 + } + } + } + ], + "totals": { + "functions": { + "count": 4, + "covered": 4, + "percent": 100 + }, + "instantiations": { + "count": 5, + "covered": 5, + "percent": 100 + }, + "lines": { + "count": 37, + "covered": 20, + "percent": 54.054054054054056 + }, + "regions": { + "count": 17, + "covered": 7, + "notcovered": 10, + "percent": 41.17647058823529 + } + } + } + ], + "type": "llvm.coverage.json.export", + "version": "2.0.1" +} diff --git a/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.async.txt b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.async.txt index f6d02891eea..5c9dc0d22b5 100644 --- a/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.async.txt +++ b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.async.txt @@ -93,39 +93,43 @@ 88| | } 89| 1|} 90| | - 91| 1|fn main() { - 92| 1| let _ = g(10); - 93| 1| let _ = h(9); - 94| 1| let mut future = Box::pin(i(8)); - 95| 1| j(7); - 96| 1| l(6); - 97| 1| executor::block_on(future.as_mut()); - 98| 1|} - 99| | - 100| |mod executor { - 101| | use core::{ - 102| | future::Future, - 103| | pin::Pin, - 104| | task::{Context, Poll, RawWaker, RawWakerVTable, Waker}, - 105| | }; - 106| | - 107| 1| pub fn block_on<F: Future>(mut future: F) -> F::Output { - 108| 1| let mut future = unsafe { Pin::new_unchecked(&mut future) }; - 109| 1| - 110| 1| static VTABLE: RawWakerVTable = RawWakerVTable::new( - 111| 1| |_| unimplemented!("clone"), - 112| 1| |_| unimplemented!("wake"), - 113| 1| |_| unimplemented!("wake_by_ref"), - 114| 1| |_| (), - 115| 1| ); - 116| 1| let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) }; - 117| 1| let mut context = Context::from_waker(&waker); - 118| | - 119| | loop { - 120| 1| if let Poll::Ready(val) = future.as_mut().poll(&mut context) { - 121| 1| break val; - 122| 0| } - 123| | } - 124| 1| } - 125| |} + 91| 1|async fn m(x: u8) -> u8 { x - 1 } + ^0 + 92| | + 93| 1|fn main() { + 94| 1| let _ = g(10); + 95| 1| let _ = h(9); + 96| 1| let mut future = Box::pin(i(8)); + 97| 1| j(7); + 98| 1| l(6); + 99| 1| let _ = m(5); + 100| 1| executor::block_on(future.as_mut()); + 101| 1|} + 102| | + 103| |mod executor { + 104| | use core::{ + 105| | future::Future, + 106| | pin::Pin, + 107| | task::{Context, Poll, RawWaker, RawWakerVTable, Waker}, + 108| | }; + 109| | + 110| 1| pub fn block_on<F: Future>(mut future: F) -> F::Output { + 111| 1| let mut future = unsafe { Pin::new_unchecked(&mut future) }; + 112| 1| + 113| 1| static VTABLE: RawWakerVTable = RawWakerVTable::new( + 114| 1| |_| unimplemented!("clone"), + 115| 1| |_| unimplemented!("wake"), + 116| 1| |_| unimplemented!("wake_by_ref"), + 117| 1| |_| (), + 118| 1| ); + 119| 1| let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) }; + 120| 1| let mut context = Context::from_waker(&waker); + 121| | + 122| | loop { + 123| 1| if let Poll::Ready(val) = future.as_mut().poll(&mut context) { + 124| 1| break val; + 125| 0| } + 126| | } + 127| 1| } + 128| |} diff --git a/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.partial_eq.txt b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.partial_eq.txt index c05cb36cd02..0fe124f12d9 100644 --- a/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.partial_eq.txt +++ b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.partial_eq.txt @@ -45,4 +45,19 @@ 44| |`function_source_hash` without a code region, if necessary. 45| | 46| |*/ + 47| | + 48| |// FIXME(#79626): The derived traits get coverage, which is great, but some of the traits appear + 49| |// to get two coverage execution counts at different positions: + 50| |// + 51| |// ```text + 52| |// 4| 2|#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] + 53| |// ^0 ^0 ^0 ^0 ^1 ^0 ^0^0 + 54| |// ```text + 55| |// + 56| |// `PartialEq`, `PartialOrd`, and `Ord` (and possibly `Eq`, if the trait name was longer than 2 + 57| |// characters) have counts at their first and last characters. + 58| |// + 59| |// Why is this? Why does `PartialOrd` have two values (1 and 0)? This must mean we are checking + 60| |// distinct coverages, so maybe we don't want to eliminate one of them. Should we merge them? + 61| |// If merged, do we lose some information? diff --git a/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.uses_crate.txt b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.uses_crate.txt new file mode 100644 index 00000000000..81b355a29ac --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.uses_crate.txt @@ -0,0 +1,69 @@ +../coverage/used_crate/mod.rs: + 1| |#![allow(unused_assignments, unused_variables)] + 2| | + 3| |use std::fmt::Debug; + 4| | + 5| 1|pub fn used_function() { + 6| | // Initialize test constants in a way that cannot be determined at compile time, to ensure + 7| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + 8| | // dependent conditions. + 9| 1| let is_true = std::env::args().len() == 1; + 10| 1| let mut countdown = 0; + 11| 1| if is_true { + 12| 1| countdown = 10; + 13| 1| } + ^0 + 14| 1| used_twice_generic_function("some str"); + 15| 1|} + 16| | + 17| 1|pub fn used_generic_function<T: Debug>(arg: T) { + 18| 1| println!("used_generic_function with {:?}", arg); + 19| 1|} + 20| | + 21| 2|pub fn used_twice_generic_function<T: Debug>(arg: T) { + 22| 2| println!("used_twice_generic_function with {:?}", arg); + 23| 2|} + ------------------ + | uses_crate::used_crate::used_twice_generic_function::<alloc::vec::Vec<i32>>: + | 21| 1|pub fn used_twice_generic_function<T: Debug>(arg: T) { + | 22| 1| println!("used_twice_generic_function with {:?}", arg); + | 23| 1|} + ------------------ + | uses_crate::used_crate::used_twice_generic_function::<&str>: + | 21| 1|pub fn used_twice_generic_function<T: Debug>(arg: T) { + | 22| 1| println!("used_twice_generic_function with {:?}", arg); + | 23| 1|} + ------------------ + 24| | + 25| 0|pub fn unused_generic_function<T: Debug>(arg: T) { + 26| 0| println!("unused_generic_function with {:?}", arg); + 27| 0|} + 28| | + 29| 0|pub fn unused_function() { + 30| 0| let is_true = std::env::args().len() == 1; + 31| 0| let mut countdown = 2; + 32| 0| if !is_true { + 33| 0| countdown = 20; + 34| 0| } + 35| 0|} + 36| | + 37| 0|fn unused_private_function() { + 38| 0| let is_true = std::env::args().len() == 1; + 39| 0| let mut countdown = 2; + 40| 0| if !is_true { + 41| 0| countdown = 20; + 42| 0| } + 43| 0|} + +../coverage/uses_crate.rs: + 1| |#![allow(unused_assignments, unused_variables)] + 2| | + 3| |mod used_crate; + 4| | + 5| 1|fn main() { + 6| 1| used_crate::used_function(); + 7| 1| let some_vec = vec![1, 2, 3, 4]; + 8| 1| used_crate::used_generic_function(&some_vec); + 9| 1| used_crate::used_twice_generic_function(some_vec); + 10| 1|} + diff --git a/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage_counters.async.txt b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage_counters.async.txt index ce6ee3b1ed8..2fac0fea84b 100644 --- a/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage_counters.async.txt +++ b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage_counters.async.txt @@ -26,18 +26,18 @@ Counter in file 0 77:14 -> 77:16, 0 Counter in file 0 78:14 -> 78:16, 0 Counter in file 0 79:14 -> 79:16, 0 Counter in file 0 81:1 -> 81:2, 0 +Counter in file 0 91:25 -> 91:34, 0 Counter in file 0 5:1 -> 5:25, #1 -Counter in file 0 21:1 -> 21:23, #1 -Counter in file 0 17:20 -> 17:21, #1 -Counter in file 0 67:5 -> 67:23, #1 -Counter in file 0 38:1 -> 38:19, #1 -Counter in file 0 13:20 -> 13:21, #1 -Counter in file 0 29:1 -> 29:22, #1 -Counter in file 0 91:1 -> 98:2, #1 Counter in file 0 5:25 -> 6:14, #1 Counter in file 0 7:9 -> 7:10, #2 Counter in file 0 9:9 -> 9:10, (#1 - #2) Counter in file 0 11:1 -> 11:2, (#2 + (#1 - #2)) +Counter in file 0 21:1 -> 21:23, #1 +Counter in file 0 67:5 -> 67:23, #1 +Counter in file 0 38:1 -> 38:19, #1 +Counter in file 0 29:1 -> 29:22, #1 +Counter in file 0 93:1 -> 101:2, #1 +Counter in file 0 91:1 -> 91:25, #1 Counter in file 0 38:19 -> 42:12, #1 Counter in file 0 43:9 -> 43:10, #3 Counter in file 0 43:14 -> 43:18, (#1 + 0) @@ -53,6 +53,7 @@ Counter in file 0 51:5 -> 52:18, #1 Counter in file 0 53:13 -> 53:14, #2 Counter in file 0 63:13 -> 63:14, (#1 - #2) Counter in file 0 65:5 -> 65:6, (#2 + (#1 - #2)) +Counter in file 0 17:20 -> 17:21, #1 Counter in file 0 49:1 -> 68:12, #1 Counter in file 0 69:9 -> 69:10, #2 Counter in file 0 69:14 -> 69:27, (#1 + 0) @@ -68,17 +69,18 @@ Counter in file 0 86:14 -> 86:16, #2 Counter in file 0 87:14 -> 87:16, #3 Counter in file 0 89:1 -> 89:2, (#3 + (#2 + (#1 - (#3 + #2)))) Counter in file 0 17:1 -> 17:20, #1 +Counter in file 0 13:20 -> 13:21, #1 Counter in file 0 66:5 -> 66:23, #1 -Counter in file 0 107:5 -> 117:54, #1 -Counter in file 0 120:32 -> 120:35, ((#1 + #2) - #2) -Counter in file 0 120:39 -> 120:73, (#1 + #2) -Counter in file 0 121:23 -> 121:26, (((#1 + #2) - #2) + 0) -Counter in file 0 122:14 -> 122:15, #2 -Counter in file 0 124:5 -> 124:6, (((#1 + #2) - #2) + 0) -Counter in file 0 114:17 -> 114:19, #1 Counter in file 0 17:9 -> 17:10, #1 Counter in file 0 17:9 -> 17:10, #1 +Counter in file 0 117:17 -> 117:19, #1 Counter in file 0 17:9 -> 17:10, #1 +Counter in file 0 110:5 -> 120:54, #1 +Counter in file 0 123:32 -> 123:35, ((#1 + #2) - #2) +Counter in file 0 123:39 -> 123:73, (#1 + #2) +Counter in file 0 124:23 -> 124:26, (((#1 + #2) - #2) + 0) +Counter in file 0 125:14 -> 125:15, #2 +Counter in file 0 127:5 -> 127:6, (((#1 + #2) - #2) + 0) Emitting segments for file: ../coverage/async.rs Combined regions: 5:1 -> 5:25 (count=1) @@ -149,14 +151,16 @@ Combined regions: 86:14 -> 86:16 (count=0) 87:14 -> 87:16 (count=1) 89:1 -> 89:2 (count=1) - 91:1 -> 98:2 (count=1) - 107:5 -> 117:54 (count=1) - 114:17 -> 114:19 (count=1) - 120:32 -> 120:35 (count=1) - 120:39 -> 120:73 (count=1) - 121:23 -> 121:26 (count=1) - 122:14 -> 122:15 (count=0) - 124:5 -> 124:6 (count=1) + 91:1 -> 91:25 (count=1) + 91:25 -> 91:34 (count=0) + 93:1 -> 101:2 (count=1) + 110:5 -> 120:54 (count=1) + 117:17 -> 117:19 (count=1) + 123:32 -> 123:35 (count=1) + 123:39 -> 123:73 (count=1) + 124:23 -> 124:26 (count=1) + 125:14 -> 125:15 (count=0) + 127:5 -> 127:6 (count=1) Segment at 5:1 (count = 1), RegionEntry Segment at 5:25 (count = 1), RegionEntry Segment at 6:14 (count = 0), Skipped @@ -287,18 +291,21 @@ Segment at 87:16 (count = 0), Skipped Segment at 89:1 (count = 1), RegionEntry Segment at 89:2 (count = 0), Skipped Segment at 91:1 (count = 1), RegionEntry -Segment at 98:2 (count = 0), Skipped -Segment at 107:5 (count = 1), RegionEntry -Segment at 114:17 (count = 1), RegionEntry -Segment at 114:19 (count = 1) -Segment at 117:54 (count = 0), Skipped -Segment at 120:32 (count = 1), RegionEntry -Segment at 120:35 (count = 0), Skipped -Segment at 120:39 (count = 1), RegionEntry -Segment at 120:73 (count = 0), Skipped -Segment at 121:23 (count = 1), RegionEntry -Segment at 121:26 (count = 0), Skipped -Segment at 122:14 (count = 0), RegionEntry -Segment at 122:15 (count = 0), Skipped -Segment at 124:5 (count = 1), RegionEntry -Segment at 124:6 (count = 0), Skipped +Segment at 91:25 (count = 0), RegionEntry +Segment at 91:34 (count = 0), Skipped +Segment at 93:1 (count = 1), RegionEntry +Segment at 101:2 (count = 0), Skipped +Segment at 110:5 (count = 1), RegionEntry +Segment at 117:17 (count = 1), RegionEntry +Segment at 117:19 (count = 1) +Segment at 120:54 (count = 0), Skipped +Segment at 123:32 (count = 1), RegionEntry +Segment at 123:35 (count = 0), Skipped +Segment at 123:39 (count = 1), RegionEntry +Segment at 123:73 (count = 0), Skipped +Segment at 124:23 (count = 1), RegionEntry +Segment at 124:26 (count = 0), Skipped +Segment at 125:14 (count = 0), RegionEntry +Segment at 125:15 (count = 0), Skipped +Segment at 127:5 (count = 1), RegionEntry +Segment at 127:6 (count = 0), Skipped diff --git a/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage_counters.uses_crate.txt b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage_counters.uses_crate.txt new file mode 100644 index 00000000000..8901019f191 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage_counters.uses_crate.txt @@ -0,0 +1,80 @@ +Counter in file 0 17:1 -> 19:2, #1 +Counter in file 0 25:1 -> 27:2, 0 +Counter in file 0 29:1 -> 32:16, 0 +Counter in file 0 32:17 -> 34:6, 0 +Counter in file 0 34:6 -> 34:7, 0 +Counter in file 0 35:1 -> 35:2, 0 +Counter in file 0 37:1 -> 40:16, 0 +Counter in file 0 40:17 -> 42:6, 0 +Counter in file 0 42:6 -> 42:7, 0 +Counter in file 0 43:1 -> 43:2, 0 +Counter in file 0 5:1 -> 5:24, #1 +Counter in file 0 9:9 -> 11:15, (#1 + 0) +Counter in file 0 11:16 -> 13:6, #2 +Counter in file 0 13:6 -> 13:7, (#1 - #2) +Counter in file 0 14:5 -> 15:2, (#2 + (#1 - #2)) +Counter in file 0 21:1 -> 23:2, #1 +Counter in file 0 21:1 -> 23:2, #1 +Counter in file 0 5:1 -> 10:2, #1 +Emitting segments for file: ../coverage/used_crate/mod.rs +Combined regions: + 5:1 -> 5:24 (count=1) + 9:9 -> 11:15 (count=1) + 11:16 -> 13:6 (count=1) + 13:6 -> 13:7 (count=0) + 14:5 -> 15:2 (count=1) + 17:1 -> 19:2 (count=1) + 21:1 -> 23:2 (count=2) + 25:1 -> 27:2 (count=0) + 29:1 -> 32:16 (count=0) + 32:17 -> 34:6 (count=0) + 34:6 -> 34:7 (count=0) + 35:1 -> 35:2 (count=0) + 37:1 -> 40:16 (count=0) + 40:17 -> 42:6 (count=0) + 42:6 -> 42:7 (count=0) + 43:1 -> 43:2 (count=0) +Segment at 5:1 (count = 1), RegionEntry +Segment at 5:24 (count = 0), Skipped +Segment at 9:9 (count = 1), RegionEntry +Segment at 11:15 (count = 0), Skipped +Segment at 11:16 (count = 1), RegionEntry +Segment at 13:6 (count = 0), RegionEntry +Segment at 13:7 (count = 0), Skipped +Segment at 14:5 (count = 1), RegionEntry +Segment at 15:2 (count = 0), Skipped +Segment at 17:1 (count = 1), RegionEntry +Segment at 19:2 (count = 0), Skipped +Segment at 21:1 (count = 2), RegionEntry +Segment at 23:2 (count = 0), Skipped +Segment at 25:1 (count = 0), RegionEntry +Segment at 27:2 (count = 0), Skipped +Segment at 29:1 (count = 0), RegionEntry +Segment at 32:16 (count = 0), Skipped +Segment at 32:17 (count = 0), RegionEntry +Segment at 34:6 (count = 0), RegionEntry +Segment at 34:7 (count = 0), Skipped +Segment at 35:1 (count = 0), RegionEntry +Segment at 35:2 (count = 0), Skipped +Segment at 37:1 (count = 0), RegionEntry +Segment at 40:16 (count = 0), Skipped +Segment at 40:17 (count = 0), RegionEntry +Segment at 42:6 (count = 0), RegionEntry +Segment at 42:7 (count = 0), Skipped +Segment at 43:1 (count = 0), RegionEntry +Segment at 43:2 (count = 0), Skipped +Emitting segments for function: _RINvNtCs4fqI2P2rA04_10uses_crate10used_crate27used_twice_generic_functionINtNtCs3QflaznQylx_5alloc3vec3VeclEEB4_ +Combined regions: + 21:1 -> 23:2 (count=1) +Segment at 21:1 (count = 1), RegionEntry +Segment at 23:2 (count = 0), Skipped +Emitting segments for function: _RINvNtCs4fqI2P2rA04_10uses_crate10used_crate27used_twice_generic_functionReEB4_ +Combined regions: + 21:1 -> 23:2 (count=1) +Segment at 21:1 (count = 1), RegionEntry +Segment at 23:2 (count = 0), Skipped +Emitting segments for file: ../coverage/uses_crate.rs +Combined regions: + 5:1 -> 10:2 (count=1) +Segment at 5:1 (count = 1), RegionEntry +Segment at 10:2 (count = 0), Skipped diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.executor-block_on-VTABLE-{closure#3}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.executor-block_on-VTABLE-{closure#3}.-------.InstrumentCoverage.0.html index 996c537225d..ef2fe7d0682 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.executor-block_on-VTABLE-{closure#3}.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.executor-block_on-VTABLE-{closure#3}.-------.InstrumentCoverage.0.html @@ -69,7 +69,7 @@ For revisions in Pull Requests (PR): </style> </head> <body> -<div class="code" style="counter-reset: line 113"><span class="line"> <span class="code" style="--layer: 0">|_| </span><span><span class="code even" style="--layer: 1" title="114:17-114:19: @0[0]: _0 = () -114:19-114:19: @0.Return: return"><span class="annotation">@0⦊</span>()<span class="annotation">⦉@0</span></span></span></span></div> +<div class="code" style="counter-reset: line 116"><span class="line"> <span class="code" style="--layer: 0">|_| </span><span><span class="code even" style="--layer: 1" title="117:17-117:19: @0[0]: _0 = () +117:19-117:19: @0.Return: return"><span class="annotation">@0⦊</span>()<span class="annotation">⦉@0</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.executor-block_on.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.executor-block_on.-------.InstrumentCoverage.0.html index 0c597d40de0..81310c8cb25 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.executor-block_on.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.executor-block_on.-------.InstrumentCoverage.0.html @@ -69,171 +69,171 @@ For revisions in Pull Requests (PR): </style> </head> <body> -<div class="code" style="counter-reset: line 106"><span class="line"> <span><span class="code even" style="--layer: 1" title="108:54-108:65: @0[2]: _3 = &mut _1 -108:35-108:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] -108:13-108:23: @1[1]: FakeRead(ForLet, _2) -116:60-116:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] -116:80-116:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} -116:79-116:86: @2[4]: _8 = &(*_9) -116:79-116:86: @2[5]: _7 = &(*_8) -116:46-116:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] -116:30-116:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] -116:13-116:18: @4[1]: FakeRead(ForLet, _4) -117:47-117:53: @4[7]: _12 = &_4 -117:47-117:53: @4[8]: _11 = &(*_12) -117:27-117:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] -117:13-117:24: @5[1]: FakeRead(ForLet, _10)"><span class="annotation">@0,1,2,3,4,5⦊</span>pub fn block_on<F: Future>(mut future: F) -> F::Output {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="108:54-108:65: @0[2]: _3 = &mut _1 -108:35-108:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] -108:13-108:23: @1[1]: FakeRead(ForLet, _2) -116:60-116:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] -116:80-116:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} -116:79-116:86: @2[4]: _8 = &(*_9) -116:79-116:86: @2[5]: _7 = &(*_8) -116:46-116:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] -116:30-116:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] -116:13-116:18: @4[1]: FakeRead(ForLet, _4) -117:47-117:53: @4[7]: _12 = &_4 -117:47-117:53: @4[8]: _11 = &(*_12) -117:27-117:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] -117:13-117:24: @5[1]: FakeRead(ForLet, _10)"> let mut future = unsafe { Pin::new_unchecked(&mut future) };</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="108:54-108:65: @0[2]: _3 = &mut _1 -108:35-108:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] -108:13-108:23: @1[1]: FakeRead(ForLet, _2) -116:60-116:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] -116:80-116:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} -116:79-116:86: @2[4]: _8 = &(*_9) -116:79-116:86: @2[5]: _7 = &(*_8) -116:46-116:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] -116:30-116:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] -116:13-116:18: @4[1]: FakeRead(ForLet, _4) -117:47-117:53: @4[7]: _12 = &_4 -117:47-117:53: @4[8]: _11 = &(*_12) -117:27-117:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] -117:13-117:24: @5[1]: FakeRead(ForLet, _10)"></span></span> -<span class="line"><span class="code even" style="--layer: 1" title="108:54-108:65: @0[2]: _3 = &mut _1 -108:35-108:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] -108:13-108:23: @1[1]: FakeRead(ForLet, _2) -116:60-116:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] -116:80-116:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} -116:79-116:86: @2[4]: _8 = &(*_9) -116:79-116:86: @2[5]: _7 = &(*_8) -116:46-116:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] -116:30-116:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] -116:13-116:18: @4[1]: FakeRead(ForLet, _4) -117:47-117:53: @4[7]: _12 = &_4 -117:47-117:53: @4[8]: _11 = &(*_12) -117:27-117:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] -117:13-117:24: @5[1]: FakeRead(ForLet, _10)"> static VTABLE: RawWakerVTable = RawWakerVTable::new(</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="108:54-108:65: @0[2]: _3 = &mut _1 -108:35-108:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] -108:13-108:23: @1[1]: FakeRead(ForLet, _2) -116:60-116:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] -116:80-116:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} -116:79-116:86: @2[4]: _8 = &(*_9) -116:79-116:86: @2[5]: _7 = &(*_8) -116:46-116:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] -116:30-116:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] -116:13-116:18: @4[1]: FakeRead(ForLet, _4) -117:47-117:53: @4[7]: _12 = &_4 -117:47-117:53: @4[8]: _11 = &(*_12) -117:27-117:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] -117:13-117:24: @5[1]: FakeRead(ForLet, _10)"> |_| unimplemented!("clone"),</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="108:54-108:65: @0[2]: _3 = &mut _1 -108:35-108:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] -108:13-108:23: @1[1]: FakeRead(ForLet, _2) -116:60-116:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] -116:80-116:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} -116:79-116:86: @2[4]: _8 = &(*_9) -116:79-116:86: @2[5]: _7 = &(*_8) -116:46-116:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] -116:30-116:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] -116:13-116:18: @4[1]: FakeRead(ForLet, _4) -117:47-117:53: @4[7]: _12 = &_4 -117:47-117:53: @4[8]: _11 = &(*_12) -117:27-117:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] -117:13-117:24: @5[1]: FakeRead(ForLet, _10)"> |_| unimplemented!("wake"),</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="108:54-108:65: @0[2]: _3 = &mut _1 -108:35-108:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] -108:13-108:23: @1[1]: FakeRead(ForLet, _2) -116:60-116:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] -116:80-116:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} -116:79-116:86: @2[4]: _8 = &(*_9) -116:79-116:86: @2[5]: _7 = &(*_8) -116:46-116:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] -116:30-116:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] -116:13-116:18: @4[1]: FakeRead(ForLet, _4) -117:47-117:53: @4[7]: _12 = &_4 -117:47-117:53: @4[8]: _11 = &(*_12) -117:27-117:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] -117:13-117:24: @5[1]: FakeRead(ForLet, _10)"> |_| unimplemented!("wake_by_ref"),</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="108:54-108:65: @0[2]: _3 = &mut _1 -108:35-108:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] -108:13-108:23: @1[1]: FakeRead(ForLet, _2) -116:60-116:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] -116:80-116:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} -116:79-116:86: @2[4]: _8 = &(*_9) -116:79-116:86: @2[5]: _7 = &(*_8) -116:46-116:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] -116:30-116:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] -116:13-116:18: @4[1]: FakeRead(ForLet, _4) -117:47-117:53: @4[7]: _12 = &_4 -117:47-117:53: @4[8]: _11 = &(*_12) -117:27-117:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] -117:13-117:24: @5[1]: FakeRead(ForLet, _10)"> |_| (),</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="108:54-108:65: @0[2]: _3 = &mut _1 -108:35-108:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] -108:13-108:23: @1[1]: FakeRead(ForLet, _2) -116:60-116:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] -116:80-116:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} -116:79-116:86: @2[4]: _8 = &(*_9) -116:79-116:86: @2[5]: _7 = &(*_8) -116:46-116:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] -116:30-116:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] -116:13-116:18: @4[1]: FakeRead(ForLet, _4) -117:47-117:53: @4[7]: _12 = &_4 -117:47-117:53: @4[8]: _11 = &(*_12) -117:27-117:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] -117:13-117:24: @5[1]: FakeRead(ForLet, _10)"> );</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="108:54-108:65: @0[2]: _3 = &mut _1 -108:35-108:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] -108:13-108:23: @1[1]: FakeRead(ForLet, _2) -116:60-116:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] -116:80-116:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} -116:79-116:86: @2[4]: _8 = &(*_9) -116:79-116:86: @2[5]: _7 = &(*_8) -116:46-116:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] -116:30-116:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] -116:13-116:18: @4[1]: FakeRead(ForLet, _4) -117:47-117:53: @4[7]: _12 = &_4 -117:47-117:53: @4[8]: _11 = &(*_12) -117:27-117:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] -117:13-117:24: @5[1]: FakeRead(ForLet, _10)"> let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="108:54-108:65: @0[2]: _3 = &mut _1 -108:35-108:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] -108:13-108:23: @1[1]: FakeRead(ForLet, _2) -116:60-116:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] -116:80-116:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} -116:79-116:86: @2[4]: _8 = &(*_9) -116:79-116:86: @2[5]: _7 = &(*_8) -116:46-116:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] -116:30-116:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] -116:13-116:18: @4[1]: FakeRead(ForLet, _4) -117:47-117:53: @4[7]: _12 = &_4 -117:47-117:53: @4[8]: _11 = &(*_12) -117:27-117:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] -117:13-117:24: @5[1]: FakeRead(ForLet, _10)"> let mut context = Context::from_waker(&waker)<span class="annotation">⦉@0,1,2,3,4,5</span></span></span><span class="code" style="--layer: 0">;</span></span> +<div class="code" style="counter-reset: line 109"><span class="line"> <span><span class="code even" style="--layer: 1" title="111:54-111:65: @0[2]: _3 = &mut _1 +111:35-111:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] +111:13-111:23: @1[1]: FakeRead(ForLet, _2) +119:60-119:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] +119:80-119:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} +119:79-119:86: @2[4]: _8 = &(*_9) +119:79-119:86: @2[5]: _7 = &(*_8) +119:46-119:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] +119:30-119:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] +119:13-119:18: @4[1]: FakeRead(ForLet, _4) +120:47-120:53: @4[7]: _12 = &_4 +120:47-120:53: @4[8]: _11 = &(*_12) +120:27-120:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] +120:13-120:24: @5[1]: FakeRead(ForLet, _10)"><span class="annotation">@0,1,2,3,4,5⦊</span>pub fn block_on<F: Future>(mut future: F) -> F::Output {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="111:54-111:65: @0[2]: _3 = &mut _1 +111:35-111:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] +111:13-111:23: @1[1]: FakeRead(ForLet, _2) +119:60-119:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] +119:80-119:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} +119:79-119:86: @2[4]: _8 = &(*_9) +119:79-119:86: @2[5]: _7 = &(*_8) +119:46-119:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] +119:30-119:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] +119:13-119:18: @4[1]: FakeRead(ForLet, _4) +120:47-120:53: @4[7]: _12 = &_4 +120:47-120:53: @4[8]: _11 = &(*_12) +120:27-120:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] +120:13-120:24: @5[1]: FakeRead(ForLet, _10)"> let mut future = unsafe { Pin::new_unchecked(&mut future) };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="111:54-111:65: @0[2]: _3 = &mut _1 +111:35-111:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] +111:13-111:23: @1[1]: FakeRead(ForLet, _2) +119:60-119:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] +119:80-119:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} +119:79-119:86: @2[4]: _8 = &(*_9) +119:79-119:86: @2[5]: _7 = &(*_8) +119:46-119:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] +119:30-119:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] +119:13-119:18: @4[1]: FakeRead(ForLet, _4) +120:47-120:53: @4[7]: _12 = &_4 +120:47-120:53: @4[8]: _11 = &(*_12) +120:27-120:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] +120:13-120:24: @5[1]: FakeRead(ForLet, _10)"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="111:54-111:65: @0[2]: _3 = &mut _1 +111:35-111:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] +111:13-111:23: @1[1]: FakeRead(ForLet, _2) +119:60-119:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] +119:80-119:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} +119:79-119:86: @2[4]: _8 = &(*_9) +119:79-119:86: @2[5]: _7 = &(*_8) +119:46-119:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] +119:30-119:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] +119:13-119:18: @4[1]: FakeRead(ForLet, _4) +120:47-120:53: @4[7]: _12 = &_4 +120:47-120:53: @4[8]: _11 = &(*_12) +120:27-120:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] +120:13-120:24: @5[1]: FakeRead(ForLet, _10)"> static VTABLE: RawWakerVTable = RawWakerVTable::new(</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="111:54-111:65: @0[2]: _3 = &mut _1 +111:35-111:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] +111:13-111:23: @1[1]: FakeRead(ForLet, _2) +119:60-119:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] +119:80-119:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} +119:79-119:86: @2[4]: _8 = &(*_9) +119:79-119:86: @2[5]: _7 = &(*_8) +119:46-119:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] +119:30-119:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] +119:13-119:18: @4[1]: FakeRead(ForLet, _4) +120:47-120:53: @4[7]: _12 = &_4 +120:47-120:53: @4[8]: _11 = &(*_12) +120:27-120:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] +120:13-120:24: @5[1]: FakeRead(ForLet, _10)"> |_| unimplemented!("clone"),</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="111:54-111:65: @0[2]: _3 = &mut _1 +111:35-111:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] +111:13-111:23: @1[1]: FakeRead(ForLet, _2) +119:60-119:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] +119:80-119:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} +119:79-119:86: @2[4]: _8 = &(*_9) +119:79-119:86: @2[5]: _7 = &(*_8) +119:46-119:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] +119:30-119:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] +119:13-119:18: @4[1]: FakeRead(ForLet, _4) +120:47-120:53: @4[7]: _12 = &_4 +120:47-120:53: @4[8]: _11 = &(*_12) +120:27-120:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] +120:13-120:24: @5[1]: FakeRead(ForLet, _10)"> |_| unimplemented!("wake"),</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="111:54-111:65: @0[2]: _3 = &mut _1 +111:35-111:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] +111:13-111:23: @1[1]: FakeRead(ForLet, _2) +119:60-119:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] +119:80-119:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} +119:79-119:86: @2[4]: _8 = &(*_9) +119:79-119:86: @2[5]: _7 = &(*_8) +119:46-119:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] +119:30-119:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] +119:13-119:18: @4[1]: FakeRead(ForLet, _4) +120:47-120:53: @4[7]: _12 = &_4 +120:47-120:53: @4[8]: _11 = &(*_12) +120:27-120:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] +120:13-120:24: @5[1]: FakeRead(ForLet, _10)"> |_| unimplemented!("wake_by_ref"),</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="111:54-111:65: @0[2]: _3 = &mut _1 +111:35-111:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] +111:13-111:23: @1[1]: FakeRead(ForLet, _2) +119:60-119:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] +119:80-119:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} +119:79-119:86: @2[4]: _8 = &(*_9) +119:79-119:86: @2[5]: _7 = &(*_8) +119:46-119:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] +119:30-119:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] +119:13-119:18: @4[1]: FakeRead(ForLet, _4) +120:47-120:53: @4[7]: _12 = &_4 +120:47-120:53: @4[8]: _11 = &(*_12) +120:27-120:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] +120:13-120:24: @5[1]: FakeRead(ForLet, _10)"> |_| (),</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="111:54-111:65: @0[2]: _3 = &mut _1 +111:35-111:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] +111:13-111:23: @1[1]: FakeRead(ForLet, _2) +119:60-119:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] +119:80-119:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} +119:79-119:86: @2[4]: _8 = &(*_9) +119:79-119:86: @2[5]: _7 = &(*_8) +119:46-119:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] +119:30-119:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] +119:13-119:18: @4[1]: FakeRead(ForLet, _4) +120:47-120:53: @4[7]: _12 = &_4 +120:47-120:53: @4[8]: _11 = &(*_12) +120:27-120:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] +120:13-120:24: @5[1]: FakeRead(ForLet, _10)"> );</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="111:54-111:65: @0[2]: _3 = &mut _1 +111:35-111:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] +111:13-111:23: @1[1]: FakeRead(ForLet, _2) +119:60-119:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] +119:80-119:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} +119:79-119:86: @2[4]: _8 = &(*_9) +119:79-119:86: @2[5]: _7 = &(*_8) +119:46-119:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] +119:30-119:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] +119:13-119:18: @4[1]: FakeRead(ForLet, _4) +120:47-120:53: @4[7]: _12 = &_4 +120:47-120:53: @4[8]: _11 = &(*_12) +120:27-120:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] +120:13-120:24: @5[1]: FakeRead(ForLet, _10)"> let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="111:54-111:65: @0[2]: _3 = &mut _1 +111:35-111:66: @0.Call: _2 = Pin::<&mut F>::new_unchecked(move _3) -> [return: bb1, unwind: bb20] +111:13-111:23: @1[1]: FakeRead(ForLet, _2) +119:60-119:77: @1.Call: _6 = null::<()>() -> [return: bb2, unwind: bb20] +119:80-119:86: @2[3]: _9 = const {alloc0: &RawWakerVTable} +119:79-119:86: @2[4]: _8 = &(*_9) +119:79-119:86: @2[5]: _7 = &(*_8) +119:46-119:87: @2.Call: _5 = RawWaker::new(move _6, move _7) -> [return: bb3, unwind: bb20] +119:30-119:88: @3.Call: _4 = Waker::from_raw(move _5) -> [return: bb4, unwind: bb20] +119:13-119:18: @4[1]: FakeRead(ForLet, _4) +120:47-120:53: @4[7]: _12 = &_4 +120:47-120:53: @4[8]: _11 = &(*_12) +120:27-120:54: @4.Call: _10 = Context::from_waker(move _11) -> [return: bb5, unwind: bb19] +120:13-120:24: @5[1]: FakeRead(ForLet, _10)"> let mut context = Context::from_waker(&waker)<span class="annotation">⦉@0,1,2,3,4,5</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> loop {</span></span> -<span class="line"><span class="code" style="--layer: 0"> if let Poll::Ready(</span><span><span class="code odd" style="--layer: 1" title="120:32-120:35: @12[1]: _20 = move ((_14 as Ready).0: <F as std::future::Future>::Output)"><span class="annotation">@10,12,14,15,16,17⦊</span>val<span class="annotation">⦉@10,12,14,15,16,17</span></span></span><span class="code" style="--layer: 0">) = </span><span><span class="code even" style="--layer: 1" title="120:39-120:45: @7[3]: _16 = &mut _2 -120:39-120:54: @7.Call: _15 = Pin::<&mut F>::as_mut(move _16) -> [return: bb8, unwind: bb19] -120:60-120:72: @8[3]: _18 = &mut _10 -120:60-120:72: @8[4]: _17 = &mut (*_18) -120:39-120:73: @8.Call: _14 = <F as Future>::poll(move _15, move _17) -> [return: bb9, unwind: bb19] -120:39-120:73: @9[2]: FakeRead(ForMatchedPlace, _14)"><span class="annotation">@6,7,8,9⦊</span>future.as_mut().poll(&mut context)<span class="annotation">⦉@6,7,8,9</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> break </span><span><span class="code odd" style="--layer: 1" title="121:23-121:26: @12[2]: _0 = move _20"><span class="annotation">@10,12,14,15,16,17⦊</span>val<span class="annotation">⦉@10,12,14,15,16,17</span></span></span><span class="code" style="--layer: 0">;</span></span> -<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="122:14-122:14: @11[0]: _13 = const ()"><span class="annotation">@11,13⦊</span>‸<span class="annotation">⦉@11,13</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if let Poll::Ready(</span><span><span class="code odd" style="--layer: 1" title="123:32-123:35: @12[1]: _20 = move ((_14 as Ready).0: <F as std::future::Future>::Output)"><span class="annotation">@10,12,14,15,16,17⦊</span>val<span class="annotation">⦉@10,12,14,15,16,17</span></span></span><span class="code" style="--layer: 0">) = </span><span><span class="code even" style="--layer: 1" title="123:39-123:45: @7[3]: _16 = &mut _2 +123:39-123:54: @7.Call: _15 = Pin::<&mut F>::as_mut(move _16) -> [return: bb8, unwind: bb19] +123:60-123:72: @8[3]: _18 = &mut _10 +123:60-123:72: @8[4]: _17 = &mut (*_18) +123:39-123:73: @8.Call: _14 = <F as Future>::poll(move _15, move _17) -> [return: bb9, unwind: bb19] +123:39-123:73: @9[2]: FakeRead(ForMatchedPlace, _14)"><span class="annotation">@6,7,8,9⦊</span>future.as_mut().poll(&mut context)<span class="annotation">⦉@6,7,8,9</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> break </span><span><span class="code odd" style="--layer: 1" title="124:23-124:26: @12[2]: _0 = move _20"><span class="annotation">@10,12,14,15,16,17⦊</span>val<span class="annotation">⦉@10,12,14,15,16,17</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="125:14-125:14: @11[0]: _13 = const ()"><span class="annotation">@11,13⦊</span>‸<span class="annotation">⦉@11,13</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="124:6-124:6: @17.Return: return"><span class="annotation">@10,12,14,15,16,17⦊</span>‸<span class="annotation">⦉@10,12,14,15,16,17</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="127:6-127:6: @17.Return: return"><span class="annotation">@10,12,14,15,16,17⦊</span>‸<span class="annotation">⦉@10,12,14,15,16,17</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.m-{closure#0}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.m-{closure#0}.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..9cf86ce34a0 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.m-{closure#0}.-------.InstrumentCoverage.0.html @@ -0,0 +1,79 @@ +<!DOCTYPE html> +<!-- + +Preview this file as rendered HTML from the github source at: +https://htmlpreview.github.io/?https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.m-%7Bclosure%230%7D.-------.InstrumentCoverage.0.html + +For revisions in Pull Requests (PR): + * Replace "rust-lang" with the github PR author + * Replace "master" with the PR branch name + +--> +<html> +<head> +<title>async.m-{closure#0} - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 90"><span class="line"> <span><span class="code even" style="--layer: 1" title="91:25-91:34: @0[1]: _3 = (_1.0: u8) +91:25-91:34: @0[2]: FakeRead(ForLet, _3) +91:27-91:28: @0[4]: _4 = _3 +91:27-91:32: @0[5]: _5 = CheckedSub(_4, const 1_u8) +91:27-91:32: @1[0]: _0 = move (_5.0: u8) +91:34-91:34: @1.Return: return"><span class="annotation">@0,1⦊</span>{ x - 1 }<span class="annotation">⦉@0,1</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.m.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.m.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..04412c1d994 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.m.-------.InstrumentCoverage.0.html @@ -0,0 +1,74 @@ +<!DOCTYPE html> +<!-- + +Preview this file as rendered HTML from the github source at: +https://htmlpreview.github.io/?https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.m.-------.InstrumentCoverage.0.html + +For revisions in Pull Requests (PR): + * Replace "rust-lang" with the github PR author + * Replace "master" with the PR branch name + +--> +<html> +<head> +<title>async.m - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 90"><span class="line"><span><span class="code even" style="--layer: 1"><span class="annotation">@0,1⦊</span>async fn m(x: u8) -> u8 <span class="annotation">⦉@0,1</span></span></span><span class="code" style="--layer: 0">{ x - 1 }</span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.main.-------.InstrumentCoverage.0.html index 2b0eb4f43c7..313a36ed6c2 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.main.-------.InstrumentCoverage.0.html @@ -69,101 +69,122 @@ For revisions in Pull Requests (PR): </style> </head> <body> -<div class="code" style="counter-reset: line 90"><span class="line"><span><span class="code even" style="--layer: 1" title="92:13-92:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb14] -93:13-93:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb14] -94:31-94:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb14] -94:22-94:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb13] -94:9-94:19: @6[1]: FakeRead(ForLet, _3) -95:5-95:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb12] -96:5-96:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb12] -97:24-97:30: @8[4]: _9 = &mut _3 -97:24-97:39: @8.Call: _8 = Pin::<Box<impl Future>>::as_mut(move _9) -> [return: bb9, unwind: bb12] -97:5-97:40: @9.Call: _7 = block_on::<Pin<&mut impl Future>>(move _8) -> [return: bb10, unwind: bb12] -91:11-98:2: @10[2]: _0 = const () -98:2-98:2: @11.Return: return"><span class="annotation">@0,1,2,3,4,5,6,7,8,9,10,11⦊</span>fn main() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="92:13-92:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb14] -93:13-93:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb14] -94:31-94:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb14] -94:22-94:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb13] -94:9-94:19: @6[1]: FakeRead(ForLet, _3) -95:5-95:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb12] -96:5-96:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb12] -97:24-97:30: @8[4]: _9 = &mut _3 -97:24-97:39: @8.Call: _8 = Pin::<Box<impl Future>>::as_mut(move _9) -> [return: bb9, unwind: bb12] -97:5-97:40: @9.Call: _7 = block_on::<Pin<&mut impl Future>>(move _8) -> [return: bb10, unwind: bb12] -91:11-98:2: @10[2]: _0 = const () -98:2-98:2: @11.Return: return"> let _ = g(10);</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="92:13-92:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb14] -93:13-93:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb14] -94:31-94:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb14] -94:22-94:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb13] -94:9-94:19: @6[1]: FakeRead(ForLet, _3) -95:5-95:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb12] -96:5-96:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb12] -97:24-97:30: @8[4]: _9 = &mut _3 -97:24-97:39: @8.Call: _8 = Pin::<Box<impl Future>>::as_mut(move _9) -> [return: bb9, unwind: bb12] -97:5-97:40: @9.Call: _7 = block_on::<Pin<&mut impl Future>>(move _8) -> [return: bb10, unwind: bb12] -91:11-98:2: @10[2]: _0 = const () -98:2-98:2: @11.Return: return"> let _ = h(9);</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="92:13-92:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb14] -93:13-93:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb14] -94:31-94:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb14] -94:22-94:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb13] -94:9-94:19: @6[1]: FakeRead(ForLet, _3) -95:5-95:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb12] -96:5-96:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb12] -97:24-97:30: @8[4]: _9 = &mut _3 -97:24-97:39: @8.Call: _8 = Pin::<Box<impl Future>>::as_mut(move _9) -> [return: bb9, unwind: bb12] -97:5-97:40: @9.Call: _7 = block_on::<Pin<&mut impl Future>>(move _8) -> [return: bb10, unwind: bb12] -91:11-98:2: @10[2]: _0 = const () -98:2-98:2: @11.Return: return"> let mut future = Box::pin(i(8));</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="92:13-92:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb14] -93:13-93:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb14] -94:31-94:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb14] -94:22-94:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb13] -94:9-94:19: @6[1]: FakeRead(ForLet, _3) -95:5-95:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb12] -96:5-96:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb12] -97:24-97:30: @8[4]: _9 = &mut _3 -97:24-97:39: @8.Call: _8 = Pin::<Box<impl Future>>::as_mut(move _9) -> [return: bb9, unwind: bb12] -97:5-97:40: @9.Call: _7 = block_on::<Pin<&mut impl Future>>(move _8) -> [return: bb10, unwind: bb12] -91:11-98:2: @10[2]: _0 = const () -98:2-98:2: @11.Return: return"> j(7);</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="92:13-92:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb14] -93:13-93:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb14] -94:31-94:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb14] -94:22-94:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb13] -94:9-94:19: @6[1]: FakeRead(ForLet, _3) -95:5-95:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb12] -96:5-96:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb12] -97:24-97:30: @8[4]: _9 = &mut _3 -97:24-97:39: @8.Call: _8 = Pin::<Box<impl Future>>::as_mut(move _9) -> [return: bb9, unwind: bb12] -97:5-97:40: @9.Call: _7 = block_on::<Pin<&mut impl Future>>(move _8) -> [return: bb10, unwind: bb12] -91:11-98:2: @10[2]: _0 = const () -98:2-98:2: @11.Return: return"> l(6);</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="92:13-92:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb14] -93:13-93:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb14] -94:31-94:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb14] -94:22-94:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb13] -94:9-94:19: @6[1]: FakeRead(ForLet, _3) -95:5-95:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb12] -96:5-96:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb12] -97:24-97:30: @8[4]: _9 = &mut _3 -97:24-97:39: @8.Call: _8 = Pin::<Box<impl Future>>::as_mut(move _9) -> [return: bb9, unwind: bb12] -97:5-97:40: @9.Call: _7 = block_on::<Pin<&mut impl Future>>(move _8) -> [return: bb10, unwind: bb12] -91:11-98:2: @10[2]: _0 = const () -98:2-98:2: @11.Return: return"> executor::block_on(future.as_mut());</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="92:13-92:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb14] -93:13-93:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb14] -94:31-94:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb14] -94:22-94:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb13] -94:9-94:19: @6[1]: FakeRead(ForLet, _3) -95:5-95:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb12] -96:5-96:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb12] -97:24-97:30: @8[4]: _9 = &mut _3 -97:24-97:39: @8.Call: _8 = Pin::<Box<impl Future>>::as_mut(move _9) -> [return: bb9, unwind: bb12] -97:5-97:40: @9.Call: _7 = block_on::<Pin<&mut impl Future>>(move _8) -> [return: bb10, unwind: bb12] -91:11-98:2: @10[2]: _0 = const () -98:2-98:2: @11.Return: return">}<span class="annotation">⦉@0,1,2,3,4,5,6,7,8,9,10,11</span></span></span></span></div> +<div class="code" style="counter-reset: line 92"><span class="line"><span><span class="code even" style="--layer: 1" title="94:13-94:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb16] +95:13-95:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb16] +96:31-96:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb16] +96:22-96:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb15] +96:9-96:19: @6[1]: FakeRead(ForLet, _3) +97:5-97:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb14] +98:5-98:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb14] +99:13-99:17: @8.Call: _7 = m(const 5_u8) -> [return: bb9, unwind: bb14] +100:24-100:30: @10[4]: _10 = &mut _3 +100:24-100:39: @10.Call: _9 = Pin::<Box<impl Future>>::as_mut(move _10) -> [return: bb11, unwind: bb14] +100:5-100:40: @11.Call: _8 = block_on::<Pin<&mut impl Future>>(move _9) -> [return: bb12, unwind: bb14] +93:11-101:2: @12[2]: _0 = const () +101:2-101:2: @13.Return: return"><span class="annotation">@0,1,2,3,4,5,6,7,8,9,10,11,12,13⦊</span>fn main() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="94:13-94:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb16] +95:13-95:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb16] +96:31-96:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb16] +96:22-96:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb15] +96:9-96:19: @6[1]: FakeRead(ForLet, _3) +97:5-97:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb14] +98:5-98:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb14] +99:13-99:17: @8.Call: _7 = m(const 5_u8) -> [return: bb9, unwind: bb14] +100:24-100:30: @10[4]: _10 = &mut _3 +100:24-100:39: @10.Call: _9 = Pin::<Box<impl Future>>::as_mut(move _10) -> [return: bb11, unwind: bb14] +100:5-100:40: @11.Call: _8 = block_on::<Pin<&mut impl Future>>(move _9) -> [return: bb12, unwind: bb14] +93:11-101:2: @12[2]: _0 = const () +101:2-101:2: @13.Return: return"> let _ = g(10);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="94:13-94:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb16] +95:13-95:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb16] +96:31-96:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb16] +96:22-96:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb15] +96:9-96:19: @6[1]: FakeRead(ForLet, _3) +97:5-97:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb14] +98:5-98:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb14] +99:13-99:17: @8.Call: _7 = m(const 5_u8) -> [return: bb9, unwind: bb14] +100:24-100:30: @10[4]: _10 = &mut _3 +100:24-100:39: @10.Call: _9 = Pin::<Box<impl Future>>::as_mut(move _10) -> [return: bb11, unwind: bb14] +100:5-100:40: @11.Call: _8 = block_on::<Pin<&mut impl Future>>(move _9) -> [return: bb12, unwind: bb14] +93:11-101:2: @12[2]: _0 = const () +101:2-101:2: @13.Return: return"> let _ = h(9);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="94:13-94:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb16] +95:13-95:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb16] +96:31-96:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb16] +96:22-96:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb15] +96:9-96:19: @6[1]: FakeRead(ForLet, _3) +97:5-97:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb14] +98:5-98:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb14] +99:13-99:17: @8.Call: _7 = m(const 5_u8) -> [return: bb9, unwind: bb14] +100:24-100:30: @10[4]: _10 = &mut _3 +100:24-100:39: @10.Call: _9 = Pin::<Box<impl Future>>::as_mut(move _10) -> [return: bb11, unwind: bb14] +100:5-100:40: @11.Call: _8 = block_on::<Pin<&mut impl Future>>(move _9) -> [return: bb12, unwind: bb14] +93:11-101:2: @12[2]: _0 = const () +101:2-101:2: @13.Return: return"> let mut future = Box::pin(i(8));</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="94:13-94:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb16] +95:13-95:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb16] +96:31-96:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb16] +96:22-96:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb15] +96:9-96:19: @6[1]: FakeRead(ForLet, _3) +97:5-97:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb14] +98:5-98:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb14] +99:13-99:17: @8.Call: _7 = m(const 5_u8) -> [return: bb9, unwind: bb14] +100:24-100:30: @10[4]: _10 = &mut _3 +100:24-100:39: @10.Call: _9 = Pin::<Box<impl Future>>::as_mut(move _10) -> [return: bb11, unwind: bb14] +100:5-100:40: @11.Call: _8 = block_on::<Pin<&mut impl Future>>(move _9) -> [return: bb12, unwind: bb14] +93:11-101:2: @12[2]: _0 = const () +101:2-101:2: @13.Return: return"> j(7);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="94:13-94:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb16] +95:13-95:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb16] +96:31-96:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb16] +96:22-96:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb15] +96:9-96:19: @6[1]: FakeRead(ForLet, _3) +97:5-97:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb14] +98:5-98:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb14] +99:13-99:17: @8.Call: _7 = m(const 5_u8) -> [return: bb9, unwind: bb14] +100:24-100:30: @10[4]: _10 = &mut _3 +100:24-100:39: @10.Call: _9 = Pin::<Box<impl Future>>::as_mut(move _10) -> [return: bb11, unwind: bb14] +100:5-100:40: @11.Call: _8 = block_on::<Pin<&mut impl Future>>(move _9) -> [return: bb12, unwind: bb14] +93:11-101:2: @12[2]: _0 = const () +101:2-101:2: @13.Return: return"> l(6);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="94:13-94:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb16] +95:13-95:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb16] +96:31-96:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb16] +96:22-96:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb15] +96:9-96:19: @6[1]: FakeRead(ForLet, _3) +97:5-97:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb14] +98:5-98:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb14] +99:13-99:17: @8.Call: _7 = m(const 5_u8) -> [return: bb9, unwind: bb14] +100:24-100:30: @10[4]: _10 = &mut _3 +100:24-100:39: @10.Call: _9 = Pin::<Box<impl Future>>::as_mut(move _10) -> [return: bb11, unwind: bb14] +100:5-100:40: @11.Call: _8 = block_on::<Pin<&mut impl Future>>(move _9) -> [return: bb12, unwind: bb14] +93:11-101:2: @12[2]: _0 = const () +101:2-101:2: @13.Return: return"> let _ = m(5);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="94:13-94:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb16] +95:13-95:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb16] +96:31-96:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb16] +96:22-96:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb15] +96:9-96:19: @6[1]: FakeRead(ForLet, _3) +97:5-97:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb14] +98:5-98:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb14] +99:13-99:17: @8.Call: _7 = m(const 5_u8) -> [return: bb9, unwind: bb14] +100:24-100:30: @10[4]: _10 = &mut _3 +100:24-100:39: @10.Call: _9 = Pin::<Box<impl Future>>::as_mut(move _10) -> [return: bb11, unwind: bb14] +100:5-100:40: @11.Call: _8 = block_on::<Pin<&mut impl Future>>(move _9) -> [return: bb12, unwind: bb14] +93:11-101:2: @12[2]: _0 = const () +101:2-101:2: @13.Return: return"> executor::block_on(future.as_mut());</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="94:13-94:18: @0.Call: _1 = g(const 10_u8) -> [return: bb1, unwind: bb16] +95:13-95:17: @2.Call: _2 = h(const 9_usize) -> [return: bb3, unwind: bb16] +96:31-96:35: @4.Call: _4 = i(const 8_u8) -> [return: bb5, unwind: bb16] +96:22-96:36: @5.Call: _3 = Box::<impl Future>::pin(move _4) -> [return: bb6, unwind: bb15] +96:9-96:19: @6[1]: FakeRead(ForLet, _3) +97:5-97:9: @6.Call: _5 = j(const 7_u8) -> [return: bb7, unwind: bb14] +98:5-98:9: @7.Call: _6 = l(const 6_u8) -> [return: bb8, unwind: bb14] +99:13-99:17: @8.Call: _7 = m(const 5_u8) -> [return: bb9, unwind: bb14] +100:24-100:30: @10[4]: _10 = &mut _3 +100:24-100:39: @10.Call: _9 = Pin::<Box<impl Future>>::as_mut(move _10) -> [return: bb11, unwind: bb14] +100:5-100:40: @11.Call: _8 = block_on::<Pin<&mut impl Future>>(move _9) -> [return: bb12, unwind: bb14] +93:11-101:2: @12[2]: _0 = const () +101:2-101:2: @13.Return: return">}<span class="annotation">⦉@0,1,2,3,4,5,6,7,8,9,10,11,12,13</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.main.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..52c99558de6 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.main.-------.InstrumentCoverage.0.html @@ -0,0 +1,151 @@ +<!DOCTYPE html> +<!-- + +Preview this file as rendered HTML from the github source at: +https://htmlpreview.github.io/?https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.main.-------.InstrumentCoverage.0.html + +For revisions in Pull Requests (PR): + * Replace "rust-lang" with the github PR author + * Replace "master" with the PR branch name + +--> +<html> +<head> +<title>uses_crate.main - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 4"><span class="line"><span><span class="code even" style="--layer: 1" title="6:5-6:32: @0.Call: _1 = used_function() -> [return: bb1, unwind: bb12] +7:20-7:36: @1[5]: _5 = Box([i32; 4]) +7:20-7:36: @1[6]: (*_5) = [const 1_i32, const 2_i32, const 3_i32, const 4_i32] +7:20-7:36: @1[7]: _4 = move _5 +7:20-7:36: @1[8]: _3 = move _4 as std::boxed::Box<[i32]> (Pointer(Unsize)) +7:20-7:36: @3.Call: _2 = slice::<impl [i32]>::into_vec::<std::alloc::Global>(move _3) -> [return: bb4, unwind: bb11] +7:9-7:17: @4[1]: FakeRead(ForLet, _2) +8:39-8:48: @4[4]: _7 = &_2 +8:5-8:49: @4.Call: _6 = used_generic_function::<&Vec<i32>>(move _7) -> [return: bb5, unwind: bb9] +9:45-9:53: @5[4]: _9 = move _2 +9:5-9:54: @5.Call: _8 = used_twice_generic_function::<Vec<i32>>(move _9) -> [return: bb6, unwind: bb8] +5:11-10:2: @6[2]: _0 = const () +10:2-10:2: @7.Return: return"><span class="annotation">@0,1,2,3,4,5,6,7⦊</span>fn main() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:5-6:32: @0.Call: _1 = used_function() -> [return: bb1, unwind: bb12] +7:20-7:36: @1[5]: _5 = Box([i32; 4]) +7:20-7:36: @1[6]: (*_5) = [const 1_i32, const 2_i32, const 3_i32, const 4_i32] +7:20-7:36: @1[7]: _4 = move _5 +7:20-7:36: @1[8]: _3 = move _4 as std::boxed::Box<[i32]> (Pointer(Unsize)) +7:20-7:36: @3.Call: _2 = slice::<impl [i32]>::into_vec::<std::alloc::Global>(move _3) -> [return: bb4, unwind: bb11] +7:9-7:17: @4[1]: FakeRead(ForLet, _2) +8:39-8:48: @4[4]: _7 = &_2 +8:5-8:49: @4.Call: _6 = used_generic_function::<&Vec<i32>>(move _7) -> [return: bb5, unwind: bb9] +9:45-9:53: @5[4]: _9 = move _2 +9:5-9:54: @5.Call: _8 = used_twice_generic_function::<Vec<i32>>(move _9) -> [return: bb6, unwind: bb8] +5:11-10:2: @6[2]: _0 = const () +10:2-10:2: @7.Return: return"> used_crate::used_function();</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:5-6:32: @0.Call: _1 = used_function() -> [return: bb1, unwind: bb12] +7:20-7:36: @1[5]: _5 = Box([i32; 4]) +7:20-7:36: @1[6]: (*_5) = [const 1_i32, const 2_i32, const 3_i32, const 4_i32] +7:20-7:36: @1[7]: _4 = move _5 +7:20-7:36: @1[8]: _3 = move _4 as std::boxed::Box<[i32]> (Pointer(Unsize)) +7:20-7:36: @3.Call: _2 = slice::<impl [i32]>::into_vec::<std::alloc::Global>(move _3) -> [return: bb4, unwind: bb11] +7:9-7:17: @4[1]: FakeRead(ForLet, _2) +8:39-8:48: @4[4]: _7 = &_2 +8:5-8:49: @4.Call: _6 = used_generic_function::<&Vec<i32>>(move _7) -> [return: bb5, unwind: bb9] +9:45-9:53: @5[4]: _9 = move _2 +9:5-9:54: @5.Call: _8 = used_twice_generic_function::<Vec<i32>>(move _9) -> [return: bb6, unwind: bb8] +5:11-10:2: @6[2]: _0 = const () +10:2-10:2: @7.Return: return"> let some_vec = vec![1, 2, 3, 4];</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:5-6:32: @0.Call: _1 = used_function() -> [return: bb1, unwind: bb12] +7:20-7:36: @1[5]: _5 = Box([i32; 4]) +7:20-7:36: @1[6]: (*_5) = [const 1_i32, const 2_i32, const 3_i32, const 4_i32] +7:20-7:36: @1[7]: _4 = move _5 +7:20-7:36: @1[8]: _3 = move _4 as std::boxed::Box<[i32]> (Pointer(Unsize)) +7:20-7:36: @3.Call: _2 = slice::<impl [i32]>::into_vec::<std::alloc::Global>(move _3) -> [return: bb4, unwind: bb11] +7:9-7:17: @4[1]: FakeRead(ForLet, _2) +8:39-8:48: @4[4]: _7 = &_2 +8:5-8:49: @4.Call: _6 = used_generic_function::<&Vec<i32>>(move _7) -> [return: bb5, unwind: bb9] +9:45-9:53: @5[4]: _9 = move _2 +9:5-9:54: @5.Call: _8 = used_twice_generic_function::<Vec<i32>>(move _9) -> [return: bb6, unwind: bb8] +5:11-10:2: @6[2]: _0 = const () +10:2-10:2: @7.Return: return"> used_crate::used_generic_function(&some_vec);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:5-6:32: @0.Call: _1 = used_function() -> [return: bb1, unwind: bb12] +7:20-7:36: @1[5]: _5 = Box([i32; 4]) +7:20-7:36: @1[6]: (*_5) = [const 1_i32, const 2_i32, const 3_i32, const 4_i32] +7:20-7:36: @1[7]: _4 = move _5 +7:20-7:36: @1[8]: _3 = move _4 as std::boxed::Box<[i32]> (Pointer(Unsize)) +7:20-7:36: @3.Call: _2 = slice::<impl [i32]>::into_vec::<std::alloc::Global>(move _3) -> [return: bb4, unwind: bb11] +7:9-7:17: @4[1]: FakeRead(ForLet, _2) +8:39-8:48: @4[4]: _7 = &_2 +8:5-8:49: @4.Call: _6 = used_generic_function::<&Vec<i32>>(move _7) -> [return: bb5, unwind: bb9] +9:45-9:53: @5[4]: _9 = move _2 +9:5-9:54: @5.Call: _8 = used_twice_generic_function::<Vec<i32>>(move _9) -> [return: bb6, unwind: bb8] +5:11-10:2: @6[2]: _0 = const () +10:2-10:2: @7.Return: return"> used_crate::used_twice_generic_function(some_vec);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="6:5-6:32: @0.Call: _1 = used_function() -> [return: bb1, unwind: bb12] +7:20-7:36: @1[5]: _5 = Box([i32; 4]) +7:20-7:36: @1[6]: (*_5) = [const 1_i32, const 2_i32, const 3_i32, const 4_i32] +7:20-7:36: @1[7]: _4 = move _5 +7:20-7:36: @1[8]: _3 = move _4 as std::boxed::Box<[i32]> (Pointer(Unsize)) +7:20-7:36: @3.Call: _2 = slice::<impl [i32]>::into_vec::<std::alloc::Global>(move _3) -> [return: bb4, unwind: bb11] +7:9-7:17: @4[1]: FakeRead(ForLet, _2) +8:39-8:48: @4[4]: _7 = &_2 +8:5-8:49: @4.Call: _6 = used_generic_function::<&Vec<i32>>(move _7) -> [return: bb5, unwind: bb9] +9:45-9:53: @5[4]: _9 = move _2 +9:5-9:54: @5.Call: _8 = used_twice_generic_function::<Vec<i32>>(move _9) -> [return: bb6, unwind: bb8] +5:11-10:2: @6[2]: _0 = const () +10:2-10:2: @7.Return: return">}<span class="annotation">⦉@0,1,2,3,4,5,6,7</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-unused_function.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-unused_function.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..42ba0458349 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-unused_function.-------.InstrumentCoverage.0.html @@ -0,0 +1,119 @@ +<!DOCTYPE html> +<!-- + +Preview this file as rendered HTML from the github source at: +https://htmlpreview.github.io/?https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-unused_function.-------.InstrumentCoverage.0.html + +For revisions in Pull Requests (PR): + * Replace "rust-lang" with the github PR author + * Replace "master" with the PR branch name + +--> +<html> +<head> +<title>uses_crate.used_crate-unused_function - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 28"><span class="line"><span><span class="code even" style="--layer: 1" title="30:19-30:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +30:19-30:35: @1[0]: _3 = &_4 +30:19-30:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +30:19-30:46: @2[1]: _1 = Eq(move _2, const 1_usize) +30:9-30:16: @2[3]: FakeRead(ForLet, _1) +31:25-31:26: @3[2]: _5 = const 2_i32 +31:9-31:22: @3[3]: FakeRead(ForLet, _5) +32:9-32:16: @3[6]: _7 = _1 +32:8-32:16: @3[7]: _6 = Not(move _7) +32:8-32:16: @3[9]: FakeRead(ForMatchedPlace, _6)"><span class="annotation">@0,1,2,3⦊</span>pub fn unused_function() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="30:19-30:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +30:19-30:35: @1[0]: _3 = &_4 +30:19-30:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +30:19-30:46: @2[1]: _1 = Eq(move _2, const 1_usize) +30:9-30:16: @2[3]: FakeRead(ForLet, _1) +31:25-31:26: @3[2]: _5 = const 2_i32 +31:9-31:22: @3[3]: FakeRead(ForLet, _5) +32:9-32:16: @3[6]: _7 = _1 +32:8-32:16: @3[7]: _6 = Not(move _7) +32:8-32:16: @3[9]: FakeRead(ForMatchedPlace, _6)"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="30:19-30:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +30:19-30:35: @1[0]: _3 = &_4 +30:19-30:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +30:19-30:46: @2[1]: _1 = Eq(move _2, const 1_usize) +30:9-30:16: @2[3]: FakeRead(ForLet, _1) +31:25-31:26: @3[2]: _5 = const 2_i32 +31:9-31:22: @3[3]: FakeRead(ForLet, _5) +32:9-32:16: @3[6]: _7 = _1 +32:8-32:16: @3[7]: _6 = Not(move _7) +32:8-32:16: @3[9]: FakeRead(ForMatchedPlace, _6)"> let mut countdown = 2;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="30:19-30:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +30:19-30:35: @1[0]: _3 = &_4 +30:19-30:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +30:19-30:46: @2[1]: _1 = Eq(move _2, const 1_usize) +30:9-30:16: @2[3]: FakeRead(ForLet, _1) +31:25-31:26: @3[2]: _5 = const 2_i32 +31:9-31:22: @3[3]: FakeRead(ForLet, _5) +32:9-32:16: @3[6]: _7 = _1 +32:8-32:16: @3[7]: _6 = Not(move _7) +32:8-32:16: @3[9]: FakeRead(ForMatchedPlace, _6)"> if !is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="33:9-33:23: @6[0]: _5 = const 20_i32 +32:17-34:6: @6[1]: _0 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="33:9-33:23: @6[0]: _5 = const 20_i32 +32:17-34:6: @6[1]: _0 = const ()"> countdown = 20;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="33:9-33:23: @6[0]: _5 = const 20_i32 +32:17-34:6: @6[1]: _0 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="34:6-34:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="35:2-35:2: @7.Return: return"><span class="annotation">@7⦊</span>‸<span class="annotation">⦉@7</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-unused_generic_function.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-unused_generic_function.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..d89963a32ce --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-unused_generic_function.-------.InstrumentCoverage.0.html @@ -0,0 +1,133 @@ +<!DOCTYPE html> +<!-- + +Preview this file as rendered HTML from the github source at: +https://htmlpreview.github.io/?https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-unused_generic_function.-------.InstrumentCoverage.0.html + +For revisions in Pull Requests (PR): + * Replace "rust-lang" with the github PR author + * Replace "master" with the PR branch name + +--> +<html> +<head> +<title>uses_crate.used_crate-unused_generic_function - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 24"><span class="line"><span><span class="code even" style="--layer: 1" title="26:14-26:49: @0[6]: _19 = const unused_generic_function::<T>::promoted[0] +26:14-26:49: @0[7]: _7 = &(*_19) +26:14-26:49: @0[8]: _6 = &(*_7) +26:14-26:49: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +26:51-26:54: @0[17]: _14 = &_1 +26:5-26:56: @0[18]: _13 = (move _14,) +26:5-26:56: @0[20]: FakeRead(ForMatchedPlace, _13) +26:5-26:56: @0[22]: _15 = (_13.0: &T) +26:5-26:56: @0[25]: _17 = &(*_15) +26:5-26:56: @0[27]: _18 = <T as Debug>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +26:5-26:56: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb5] +26:5-26:56: @1[2]: _12 = [move _16] +26:5-26:56: @1[5]: _11 = &_12 +26:5-26:56: @1[6]: _10 = &(*_11) +26:5-26:56: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +26:5-26:56: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb5] +26:5-26:56: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb5] +26:5-26:56: @3[6]: _2 = const () +25:50-27:2: @3[8]: _0 = const () +27:2-27:2: @4.Return: return"><span class="annotation">@0,1,2,3,4⦊</span>pub fn unused_generic_function<T: Debug>(arg: T) {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="26:14-26:49: @0[6]: _19 = const unused_generic_function::<T>::promoted[0] +26:14-26:49: @0[7]: _7 = &(*_19) +26:14-26:49: @0[8]: _6 = &(*_7) +26:14-26:49: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +26:51-26:54: @0[17]: _14 = &_1 +26:5-26:56: @0[18]: _13 = (move _14,) +26:5-26:56: @0[20]: FakeRead(ForMatchedPlace, _13) +26:5-26:56: @0[22]: _15 = (_13.0: &T) +26:5-26:56: @0[25]: _17 = &(*_15) +26:5-26:56: @0[27]: _18 = <T as Debug>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +26:5-26:56: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb5] +26:5-26:56: @1[2]: _12 = [move _16] +26:5-26:56: @1[5]: _11 = &_12 +26:5-26:56: @1[6]: _10 = &(*_11) +26:5-26:56: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +26:5-26:56: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb5] +26:5-26:56: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb5] +26:5-26:56: @3[6]: _2 = const () +25:50-27:2: @3[8]: _0 = const () +27:2-27:2: @4.Return: return"> println!("unused_generic_function with {:?}", arg);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="26:14-26:49: @0[6]: _19 = const unused_generic_function::<T>::promoted[0] +26:14-26:49: @0[7]: _7 = &(*_19) +26:14-26:49: @0[8]: _6 = &(*_7) +26:14-26:49: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +26:51-26:54: @0[17]: _14 = &_1 +26:5-26:56: @0[18]: _13 = (move _14,) +26:5-26:56: @0[20]: FakeRead(ForMatchedPlace, _13) +26:5-26:56: @0[22]: _15 = (_13.0: &T) +26:5-26:56: @0[25]: _17 = &(*_15) +26:5-26:56: @0[27]: _18 = <T as Debug>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +26:5-26:56: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb5] +26:5-26:56: @1[2]: _12 = [move _16] +26:5-26:56: @1[5]: _11 = &_12 +26:5-26:56: @1[6]: _10 = &(*_11) +26:5-26:56: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +26:5-26:56: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb5] +26:5-26:56: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb5] +26:5-26:56: @3[6]: _2 = const () +25:50-27:2: @3[8]: _0 = const () +27:2-27:2: @4.Return: return">}<span class="annotation">⦉@0,1,2,3,4</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-unused_private_function.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-unused_private_function.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..10e71152c53 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-unused_private_function.-------.InstrumentCoverage.0.html @@ -0,0 +1,119 @@ +<!DOCTYPE html> +<!-- + +Preview this file as rendered HTML from the github source at: +https://htmlpreview.github.io/?https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-unused_private_function.-------.InstrumentCoverage.0.html + +For revisions in Pull Requests (PR): + * Replace "rust-lang" with the github PR author + * Replace "master" with the PR branch name + +--> +<html> +<head> +<title>uses_crate.used_crate-unused_private_function - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 36"><span class="line"><span><span class="code even" style="--layer: 1" title="38:19-38:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +38:19-38:35: @1[0]: _3 = &_4 +38:19-38:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +38:19-38:46: @2[1]: _1 = Eq(move _2, const 1_usize) +38:9-38:16: @2[3]: FakeRead(ForLet, _1) +39:25-39:26: @3[2]: _5 = const 2_i32 +39:9-39:22: @3[3]: FakeRead(ForLet, _5) +40:9-40:16: @3[6]: _7 = _1 +40:8-40:16: @3[7]: _6 = Not(move _7) +40:8-40:16: @3[9]: FakeRead(ForMatchedPlace, _6)"><span class="annotation">@0,1,2,3⦊</span>fn unused_private_function() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="38:19-38:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +38:19-38:35: @1[0]: _3 = &_4 +38:19-38:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +38:19-38:46: @2[1]: _1 = Eq(move _2, const 1_usize) +38:9-38:16: @2[3]: FakeRead(ForLet, _1) +39:25-39:26: @3[2]: _5 = const 2_i32 +39:9-39:22: @3[3]: FakeRead(ForLet, _5) +40:9-40:16: @3[6]: _7 = _1 +40:8-40:16: @3[7]: _6 = Not(move _7) +40:8-40:16: @3[9]: FakeRead(ForMatchedPlace, _6)"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="38:19-38:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +38:19-38:35: @1[0]: _3 = &_4 +38:19-38:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +38:19-38:46: @2[1]: _1 = Eq(move _2, const 1_usize) +38:9-38:16: @2[3]: FakeRead(ForLet, _1) +39:25-39:26: @3[2]: _5 = const 2_i32 +39:9-39:22: @3[3]: FakeRead(ForLet, _5) +40:9-40:16: @3[6]: _7 = _1 +40:8-40:16: @3[7]: _6 = Not(move _7) +40:8-40:16: @3[9]: FakeRead(ForMatchedPlace, _6)"> let mut countdown = 2;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="38:19-38:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +38:19-38:35: @1[0]: _3 = &_4 +38:19-38:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +38:19-38:46: @2[1]: _1 = Eq(move _2, const 1_usize) +38:9-38:16: @2[3]: FakeRead(ForLet, _1) +39:25-39:26: @3[2]: _5 = const 2_i32 +39:9-39:22: @3[3]: FakeRead(ForLet, _5) +40:9-40:16: @3[6]: _7 = _1 +40:8-40:16: @3[7]: _6 = Not(move _7) +40:8-40:16: @3[9]: FakeRead(ForMatchedPlace, _6)"> if !is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="41:9-41:23: @6[0]: _5 = const 20_i32 +40:17-42:6: @6[1]: _0 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="41:9-41:23: @6[0]: _5 = const 20_i32 +40:17-42:6: @6[1]: _0 = const ()"> countdown = 20;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="41:9-41:23: @6[0]: _5 = const 20_i32 +40:17-42:6: @6[1]: _0 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="42:6-42:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="43:2-43:2: @7.Return: return"><span class="annotation">@7⦊</span>‸<span class="annotation">⦉@7</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-used_function.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-used_function.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..15dce97e742 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-used_function.-------.InstrumentCoverage.0.html @@ -0,0 +1,113 @@ +<!DOCTYPE html> +<!-- + +Preview this file as rendered HTML from the github source at: +https://htmlpreview.github.io/?https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-used_function.-------.InstrumentCoverage.0.html + +For revisions in Pull Requests (PR): + * Replace "rust-lang" with the github PR author + * Replace "master" with the PR branch name + +--> +<html> +<head> +<title>uses_crate.used_crate-used_function - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 4"><span class="line"><span><span class="code even" style="--layer: 1"><span class="annotation">@0,1,2,3⦊</span>pub fn used_function() <span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0">{</span></span> +<span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="9:19-9:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb10] +9:19-9:35: @1[0]: _3 = &_4 +9:19-9:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb9] +9:19-9:46: @2[1]: _1 = Eq(move _2, const 1_usize) +9:9-9:16: @2[3]: FakeRead(ForLet, _1) +10:25-10:26: @3[2]: _5 = const 0_i32 +10:9-10:22: @3[3]: FakeRead(ForLet, _5) +11:8-11:15: @3[6]: _7 = _1 +11:8-11:15: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="9:19-9:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb10] +9:19-9:35: @1[0]: _3 = &_4 +9:19-9:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb9] +9:19-9:46: @2[1]: _1 = Eq(move _2, const 1_usize) +9:9-9:16: @2[3]: FakeRead(ForLet, _1) +10:25-10:26: @3[2]: _5 = const 0_i32 +10:9-10:22: @3[3]: FakeRead(ForLet, _5) +11:8-11:15: @3[6]: _7 = _1 +11:8-11:15: @3[7]: FakeRead(ForMatchedPlace, _7)"> let mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="9:19-9:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb10] +9:19-9:35: @1[0]: _3 = &_4 +9:19-9:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb9] +9:19-9:46: @2[1]: _1 = Eq(move _2, const 1_usize) +9:9-9:16: @2[3]: FakeRead(ForLet, _1) +10:25-10:26: @3[2]: _5 = const 0_i32 +10:9-10:22: @3[3]: FakeRead(ForLet, _5) +11:8-11:15: @3[6]: _7 = _1 +11:8-11:15: @3[7]: FakeRead(ForMatchedPlace, _7)"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="12:9-12:23: @6[0]: _5 = const 10_i32 +11:16-13:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="12:9-12:23: @6[0]: _5 = const 10_i32 +11:16-13:6: @6[1]: _6 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="12:9-12:23: @6[0]: _5 = const 10_i32 +11:16-13:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="13:6-13:6: @5[0]: _6 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="14:5-14:44: @7.Call: _8 = used_twice_generic_function::<&str>(const "some str") -> [return: bb8, unwind: bb10] +15:2-15:2: @8.Return: return"><span class="annotation">@7,8⦊</span>used_twice_generic_function("some str");</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:5-14:44: @7.Call: _8 = used_twice_generic_function::<&str>(const "some str") -> [return: bb8, unwind: bb10] +15:2-15:2: @8.Return: return">}<span class="annotation">⦉@7,8</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-used_generic_function.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-used_generic_function.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..e47ed0b3817 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-used_generic_function.-------.InstrumentCoverage.0.html @@ -0,0 +1,133 @@ +<!DOCTYPE html> +<!-- + +Preview this file as rendered HTML from the github source at: +https://htmlpreview.github.io/?https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-used_generic_function.-------.InstrumentCoverage.0.html + +For revisions in Pull Requests (PR): + * Replace "rust-lang" with the github PR author + * Replace "master" with the PR branch name + +--> +<html> +<head> +<title>uses_crate.used_crate-used_generic_function - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 16"><span class="line"><span><span class="code even" style="--layer: 1" title="18:14-18:47: @0[6]: _19 = const used_generic_function::<T>::promoted[0] +18:14-18:47: @0[7]: _7 = &(*_19) +18:14-18:47: @0[8]: _6 = &(*_7) +18:14-18:47: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +18:49-18:52: @0[17]: _14 = &_1 +18:5-18:54: @0[18]: _13 = (move _14,) +18:5-18:54: @0[20]: FakeRead(ForMatchedPlace, _13) +18:5-18:54: @0[22]: _15 = (_13.0: &T) +18:5-18:54: @0[25]: _17 = &(*_15) +18:5-18:54: @0[27]: _18 = <T as Debug>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +18:5-18:54: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb5] +18:5-18:54: @1[2]: _12 = [move _16] +18:5-18:54: @1[5]: _11 = &_12 +18:5-18:54: @1[6]: _10 = &(*_11) +18:5-18:54: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +18:5-18:54: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb5] +18:5-18:54: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb5] +18:5-18:54: @3[6]: _2 = const () +17:48-19:2: @3[8]: _0 = const () +19:2-19:2: @4.Return: return"><span class="annotation">@0,1,2,3,4⦊</span>pub fn used_generic_function<T: Debug>(arg: T) {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="18:14-18:47: @0[6]: _19 = const used_generic_function::<T>::promoted[0] +18:14-18:47: @0[7]: _7 = &(*_19) +18:14-18:47: @0[8]: _6 = &(*_7) +18:14-18:47: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +18:49-18:52: @0[17]: _14 = &_1 +18:5-18:54: @0[18]: _13 = (move _14,) +18:5-18:54: @0[20]: FakeRead(ForMatchedPlace, _13) +18:5-18:54: @0[22]: _15 = (_13.0: &T) +18:5-18:54: @0[25]: _17 = &(*_15) +18:5-18:54: @0[27]: _18 = <T as Debug>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +18:5-18:54: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb5] +18:5-18:54: @1[2]: _12 = [move _16] +18:5-18:54: @1[5]: _11 = &_12 +18:5-18:54: @1[6]: _10 = &(*_11) +18:5-18:54: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +18:5-18:54: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb5] +18:5-18:54: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb5] +18:5-18:54: @3[6]: _2 = const () +17:48-19:2: @3[8]: _0 = const () +19:2-19:2: @4.Return: return"> println!("used_generic_function with {:?}", arg);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="18:14-18:47: @0[6]: _19 = const used_generic_function::<T>::promoted[0] +18:14-18:47: @0[7]: _7 = &(*_19) +18:14-18:47: @0[8]: _6 = &(*_7) +18:14-18:47: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +18:49-18:52: @0[17]: _14 = &_1 +18:5-18:54: @0[18]: _13 = (move _14,) +18:5-18:54: @0[20]: FakeRead(ForMatchedPlace, _13) +18:5-18:54: @0[22]: _15 = (_13.0: &T) +18:5-18:54: @0[25]: _17 = &(*_15) +18:5-18:54: @0[27]: _18 = <T as Debug>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +18:5-18:54: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb5] +18:5-18:54: @1[2]: _12 = [move _16] +18:5-18:54: @1[5]: _11 = &_12 +18:5-18:54: @1[6]: _10 = &(*_11) +18:5-18:54: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +18:5-18:54: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb5] +18:5-18:54: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb5] +18:5-18:54: @3[6]: _2 = const () +17:48-19:2: @3[8]: _0 = const () +19:2-19:2: @4.Return: return">}<span class="annotation">⦉@0,1,2,3,4</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-used_twice_generic_function.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-used_twice_generic_function.-------.InstrumentCoverage.0.html new file mode 100644 index 00000000000..ef63db45cc0 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-used_twice_generic_function.-------.InstrumentCoverage.0.html @@ -0,0 +1,133 @@ +<!DOCTYPE html> +<!-- + +Preview this file as rendered HTML from the github source at: +https://htmlpreview.github.io/?https://github.com/rust-lang/rust/blob/master/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.uses_crate/uses_crate.used_crate-used_twice_generic_function.-------.InstrumentCoverage.0.html + +For revisions in Pull Requests (PR): + * Replace "rust-lang" with the github PR author + * Replace "master" with the PR branch name + +--> +<html> +<head> +<title>uses_crate.used_crate-used_twice_generic_function - Coverage Spans</title> +<style> + .line { + counter-increment: line; + } + .line:before { + content: counter(line) ": "; + font-family: Menlo, Monaco, monospace; + font-style: italic; + width: 3.8em; + display: inline-block; + text-align: right; + filter: opacity(50%); + -webkit-user-select: none; + } + .code { + color: #dddddd; + background-color: #222222; + font-family: Menlo, Monaco, monospace; + line-height: 1.4em; + border-bottom: 2px solid #222222; + white-space: pre; + display: inline-block; + } + .odd { + background-color: #55bbff; + color: #223311; + } + .even { + background-color: #ee7756; + color: #551133; + } + .code { + --index: calc(var(--layer) - 1); + padding-top: calc(var(--index) * 0.15em); + filter: + hue-rotate(calc(var(--index) * 25deg)) + saturate(calc(100% - (var(--index) * 2%))) + brightness(calc(100% - (var(--index) * 1.5%))); + } + .annotation { + color: #4444ff; + font-family: monospace; + font-style: italic; + display: none; + -webkit-user-select: none; + } + body:active .annotation { + /* requires holding mouse down anywhere on the page */ + display: inline-block; + } + span:hover .annotation { + /* requires hover over a span ONLY on its first line */ + display: inline-block; + } +</style> +</head> +<body> +<div class="code" style="counter-reset: line 20"><span class="line"><span><span class="code even" style="--layer: 1" title="22:14-22:53: @0[6]: _19 = const used_twice_generic_function::<T>::promoted[0] +22:14-22:53: @0[7]: _7 = &(*_19) +22:14-22:53: @0[8]: _6 = &(*_7) +22:14-22:53: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +22:55-22:58: @0[17]: _14 = &_1 +22:5-22:60: @0[18]: _13 = (move _14,) +22:5-22:60: @0[20]: FakeRead(ForMatchedPlace, _13) +22:5-22:60: @0[22]: _15 = (_13.0: &T) +22:5-22:60: @0[25]: _17 = &(*_15) +22:5-22:60: @0[27]: _18 = <T as Debug>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +22:5-22:60: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb5] +22:5-22:60: @1[2]: _12 = [move _16] +22:5-22:60: @1[5]: _11 = &_12 +22:5-22:60: @1[6]: _10 = &(*_11) +22:5-22:60: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +22:5-22:60: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb5] +22:5-22:60: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb5] +22:5-22:60: @3[6]: _2 = const () +21:54-23:2: @3[8]: _0 = const () +23:2-23:2: @4.Return: return"><span class="annotation">@0,1,2,3,4⦊</span>pub fn used_twice_generic_function<T: Debug>(arg: T) {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:14-22:53: @0[6]: _19 = const used_twice_generic_function::<T>::promoted[0] +22:14-22:53: @0[7]: _7 = &(*_19) +22:14-22:53: @0[8]: _6 = &(*_7) +22:14-22:53: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +22:55-22:58: @0[17]: _14 = &_1 +22:5-22:60: @0[18]: _13 = (move _14,) +22:5-22:60: @0[20]: FakeRead(ForMatchedPlace, _13) +22:5-22:60: @0[22]: _15 = (_13.0: &T) +22:5-22:60: @0[25]: _17 = &(*_15) +22:5-22:60: @0[27]: _18 = <T as Debug>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +22:5-22:60: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb5] +22:5-22:60: @1[2]: _12 = [move _16] +22:5-22:60: @1[5]: _11 = &_12 +22:5-22:60: @1[6]: _10 = &(*_11) +22:5-22:60: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +22:5-22:60: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb5] +22:5-22:60: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb5] +22:5-22:60: @3[6]: _2 = const () +21:54-23:2: @3[8]: _0 = const () +23:2-23:2: @4.Return: return"> println!("used_twice_generic_function with {:?}", arg);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="22:14-22:53: @0[6]: _19 = const used_twice_generic_function::<T>::promoted[0] +22:14-22:53: @0[7]: _7 = &(*_19) +22:14-22:53: @0[8]: _6 = &(*_7) +22:14-22:53: @0[9]: _5 = move _6 as &[&str] (Pointer(Unsize)) +22:55-22:58: @0[17]: _14 = &_1 +22:5-22:60: @0[18]: _13 = (move _14,) +22:5-22:60: @0[20]: FakeRead(ForMatchedPlace, _13) +22:5-22:60: @0[22]: _15 = (_13.0: &T) +22:5-22:60: @0[25]: _17 = &(*_15) +22:5-22:60: @0[27]: _18 = <T as Debug>::fmt as for<'r, 's, 't0> fn(&'r T, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +22:5-22:60: @0.Call: _16 = ArgumentV1::new::<T>(move _17, move _18) -> [return: bb1, unwind: bb5] +22:5-22:60: @1[2]: _12 = [move _16] +22:5-22:60: @1[5]: _11 = &_12 +22:5-22:60: @1[6]: _10 = &(*_11) +22:5-22:60: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +22:5-22:60: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb5] +22:5-22:60: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb5] +22:5-22:60: @3[6]: _2 = const () +21:54-23:2: @3[8]: _0 = const () +23:2-23:2: @4.Return: return">}<span class="annotation">⦉@0,1,2,3,4</span></span></span></span></div> +</body> +</html> diff --git a/src/test/run-make-fulldeps/coverage/async.rs b/src/test/run-make-fulldeps/coverage/async.rs index fcf6f76944e..491d2746543 100644 --- a/src/test/run-make-fulldeps/coverage/async.rs +++ b/src/test/run-make-fulldeps/coverage/async.rs @@ -88,12 +88,15 @@ fn l(x: u8) { } } +async fn m(x: u8) -> u8 { x - 1 } + fn main() { let _ = g(10); let _ = h(9); let mut future = Box::pin(i(8)); j(7); l(6); + let _ = m(5); executor::block_on(future.as_mut()); } diff --git a/src/test/run-make-fulldeps/coverage/partial_eq.rs b/src/test/run-make-fulldeps/coverage/partial_eq.rs index 547026f9502..7d265ba66a4 100644 --- a/src/test/run-make-fulldeps/coverage/partial_eq.rs +++ b/src/test/run-make-fulldeps/coverage/partial_eq.rs @@ -44,3 +44,18 @@ one expression, which is allowed, but the `function_source_hash` was only passed `function_source_hash` without a code region, if necessary. */ + +// FIXME(#79626): The derived traits get coverage, which is great, but some of the traits appear +// to get two coverage execution counts at different positions: +// +// ```text +// 4| 2|#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] +// ^0 ^0 ^0 ^0 ^1 ^0 ^0^0 +// ```text +// +// `PartialEq`, `PartialOrd`, and `Ord` (and possibly `Eq`, if the trait name was longer than 2 +// characters) have counts at their first and last characters. +// +// Why is this? Why does `PartialOrd` have two values (1 and 0)? This must mean we are checking +// distinct coverages, so maybe we don't want to eliminate one of them. Should we merge them? +// If merged, do we lose some information? diff --git a/src/test/run-make-fulldeps/coverage/used_crate/mod.rs b/src/test/run-make-fulldeps/coverage/used_crate/mod.rs new file mode 100644 index 00000000000..825eff4d352 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/used_crate/mod.rs @@ -0,0 +1,43 @@ +#![allow(unused_assignments, unused_variables)] + +use std::fmt::Debug; + +pub fn used_function() { + // Initialize test constants in a way that cannot be determined at compile time, to ensure + // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from + // dependent conditions. + let is_true = std::env::args().len() == 1; + let mut countdown = 0; + if is_true { + countdown = 10; + } + used_twice_generic_function("some str"); +} + +pub fn used_generic_function<T: Debug>(arg: T) { + println!("used_generic_function with {:?}", arg); +} + +pub fn used_twice_generic_function<T: Debug>(arg: T) { + println!("used_twice_generic_function with {:?}", arg); +} + +pub fn unused_generic_function<T: Debug>(arg: T) { + println!("unused_generic_function with {:?}", arg); +} + +pub fn unused_function() { + let is_true = std::env::args().len() == 1; + let mut countdown = 2; + if !is_true { + countdown = 20; + } +} + +fn unused_private_function() { + let is_true = std::env::args().len() == 1; + let mut countdown = 2; + if !is_true { + countdown = 20; + } +} diff --git a/src/test/run-make-fulldeps/coverage/uses_crate.rs b/src/test/run-make-fulldeps/coverage/uses_crate.rs new file mode 100644 index 00000000000..473d43217a9 --- /dev/null +++ b/src/test/run-make-fulldeps/coverage/uses_crate.rs @@ -0,0 +1,10 @@ +#![allow(unused_assignments, unused_variables)] + +mod used_crate; + +fn main() { + used_crate::used_function(); + let some_vec = vec![1, 2, 3, 4]; + used_crate::used_generic_function(&some_vec); + used_crate::used_twice_generic_function(some_vec); +} |
