diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs')
-rw-r--r-- | src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs b/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs deleted file mode 100644 index b4fc33174..000000000 --- a/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs +++ /dev/null @@ -1,50 +0,0 @@ -// This test is checking that you cannot override a `forbid` by adding in other -// attributes later in the same scope. (We already ensure that you cannot -// override it in nested scopes). - -// If you turn off deduplicate diagnostics (which rustc turns on by default but -// compiletest turns off when it runs ui tests), then the errors are -// (unfortunately) repeated here because the checking is done as we read in the -// errors, and currently that happens two or three different times, depending on -// compiler flags. -// -// I decided avoiding the redundant output was not worth the time in engineering -// effort for bug like this, which 1. end users are unlikely to run into in the -// first place, and 2. they won't see the redundant output anyway. - -// compile-flags: -Z deduplicate-diagnostics=yes - -#![forbid(forbidden_lint_groups)] - -fn forbid_first(num: i32) -> i32 { - #![forbid(unused)] - #![deny(unused)] - //~^ ERROR: deny(unused) incompatible with previous forbid - //~| WARNING being phased out - #![warn(unused)] - #![allow(unused)] - - num * num -} - -fn forbid_last(num: i32) -> i32 { - #![deny(unused)] - #![warn(unused)] - #![allow(unused)] - #![forbid(unused)] - - num * num -} - -fn forbid_multiple(num: i32) -> i32 { - #![forbid(unused)] - #![forbid(unused)] - - num * num -} - -fn main() { - forbid_first(10); - forbid_last(10); - forbid_multiple(10); -} |