diff options
| author | Lzu Tao <taolzu@gmail.com> | 2024-05-24 10:51:15 +0700 |
|---|---|---|
| committer | Lzu Tao <taolzu@gmail.com> | 2024-06-08 16:50:25 +0700 |
| commit | ac600282a0cc35bd99b3e3152a655991d3c1dfea (patch) | |
| tree | 8ef77f58ce094f21c86529b49fd77b88cf91ccd2 /tests | |
| parent | e18b27aa2a37fb7597c16f72a55f26bde6badf51 (diff) | |
| download | rust-ac600282a0cc35bd99b3e3152a655991d3c1dfea.tar.gz rust-ac600282a0cc35bd99b3e3152a655991d3c1dfea.zip | |
ignore `assertions-on-constants` in const contexts
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/assertions_on_constants.rs | 1 | ||||
| -rw-r--r-- | tests/ui/assertions_on_constants.stderr | 26 |
2 files changed, 1 insertions, 26 deletions
diff --git a/tests/ui/assertions_on_constants.rs b/tests/ui/assertions_on_constants.rs index 2e0fee08a59..c3574b0b466 100644 --- a/tests/ui/assertions_on_constants.rs +++ b/tests/ui/assertions_on_constants.rs @@ -47,7 +47,6 @@ fn main() { assert!(!CFG_FLAG); const _: () = assert!(true); - //~^ ERROR: `assert!(true)` will be optimized out by the compiler // Don't lint if the value is dependent on a defined constant: const N: usize = 1024; diff --git a/tests/ui/assertions_on_constants.stderr b/tests/ui/assertions_on_constants.stderr index 3a64f1892ad..aa4868af5a8 100644 --- a/tests/ui/assertions_on_constants.stderr +++ b/tests/ui/assertions_on_constants.stderr @@ -72,29 +72,5 @@ LL | debug_assert!(true); | = help: remove it -error: `assert!(true)` will be optimized out by the compiler - --> tests/ui/assertions_on_constants.rs:49:19 - | -LL | const _: () = assert!(true); - | ^^^^^^^^^^^^^ - | - = help: remove it - -error: `assert!(true)` will be optimized out by the compiler - --> tests/ui/assertions_on_constants.rs:59:5 - | -LL | assert!(true); - | ^^^^^^^^^^^^^ - | - = help: remove it - -error: `assert!(true)` will be optimized out by the compiler - --> tests/ui/assertions_on_constants.rs:60:5 - | -LL | assert!(8 == (7 + 1)); - | ^^^^^^^^^^^^^^^^^^^^^ - | - = help: remove it - -error: aborting due to 12 previous errors +error: aborting due to 9 previous errors |
