summaryrefslogtreecommitdiffstats
path: root/tests/run-coverage/closure.coverage
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /tests/run-coverage/closure.coverage
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-coverage/closure.coverage')
-rw-r--r--tests/run-coverage/closure.coverage23
1 files changed, 14 insertions, 9 deletions
diff --git a/tests/run-coverage/closure.coverage b/tests/run-coverage/closure.coverage
index 809cf1f48..67014f792 100644
--- a/tests/run-coverage/closure.coverage
+++ b/tests/run-coverage/closure.coverage
@@ -1,11 +1,16 @@
LL| |#![allow(unused_assignments, unused_variables)]
LL| |// compile-flags: -C opt-level=2
- LL| 1|fn main() { // ^^ fix described in rustc_middle/mir/mono.rs
+ LL| |
+ LL| |// This test used to be sensitive to certain coverage-specific hacks in
+ LL| |// `rustc_middle/mir/mono.rs`, but those hacks were later cleaned up by
+ LL| |// <https://github.com/rust-lang/rust/pull/83666>.
+ LL| |
+ LL| 1|fn main() {
LL| 1| // Initialize test constants in a way that cannot be determined at compile time, to ensure
LL| 1| // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from
LL| 1| // dependent conditions.
LL| 1| let is_true = std::env::args().len() == 1;
- LL| 1| let is_false = ! is_true;
+ LL| 1| let is_false = !is_true;
LL| 1|
LL| 1| let mut some_string = Some(String::from("the string content"));
LL| 1| println!(
@@ -71,8 +76,8 @@
LL| 1| some_string = None;
LL| 1| let
LL| 1| a
- LL| 1| =
- LL| 1| ||
+ LL| | =
+ LL| | ||
LL| 1| {
LL| 1| let mut countdown = 0;
LL| 1| if is_false {
@@ -93,8 +98,8 @@
LL| 1|
LL| 1| let
LL| 1| quote_closure
- LL| 1| =
- LL| 1| |val|
+ LL| | =
+ LL| | |val|
LL| 5| {
LL| 5| let mut countdown = 0;
LL| 5| if is_false {
@@ -181,7 +186,7 @@
LL| | ;
LL| |
LL| 1| let short_used_not_covered_closure_line_break_block_embedded_branch =
- LL| 1| | _unused_arg: u8 |
+ LL| | | _unused_arg: u8 |
LL| 0| {
LL| 0| println!(
LL| 0| "not called: {}",
@@ -191,7 +196,7 @@
LL| | ;
LL| |
LL| 1| let short_used_covered_closure_line_break_no_block_embedded_branch =
- LL| 1| | _unused_arg: u8 |
+ LL| | | _unused_arg: u8 |
LL| 1| println!(
LL| 1| "not called: {}",
LL| 1| if is_true { "check" } else { "me" }
@@ -200,7 +205,7 @@
LL| | ;
LL| |
LL| 1| let short_used_covered_closure_line_break_block_embedded_branch =
- LL| 1| | _unused_arg: u8 |
+ LL| | | _unused_arg: u8 |
LL| 1| {
LL| 1| println!(
LL| 1| "not called: {}",