File tree 2 files changed +36
-0
lines changed
tests/ui/lint/unknown-lints
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ // check-pass
2
+
3
+ // Tests that the unknown_lints lint doesn't fire for an unknown lint loaded from a separate file.
4
+ // The key part is that the stderr output should be empty.
5
+ // Reported in https://github.com/rust-lang/rust/issues/84936
6
+ // Fixed incidentally by https://github.com/rust-lang/rust/pull/97266
7
+
8
+ // This `allow` should apply to submodules, whether they are inline or loaded from a file.
9
+ #![ allow( unknown_lints) ]
10
+ #![ allow( dead_code) ]
11
+ // no warning
12
+ #![ allow( not_a_real_lint) ]
13
+
14
+ mod other;
15
+
16
+ // no warning
17
+ #[ allow( not_a_real_lint) ]
18
+ fn m ( ) { }
19
+
20
+ mod mm {
21
+ // no warning
22
+ #[ allow( not_a_real_lint) ]
23
+ fn m ( ) { }
24
+ }
25
+
26
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ // ignore-test
2
+
3
+ // Companion to allow-in-other-module.rs
4
+
5
+ // This should not warn.
6
+ #![ allow( not_a_real_lint) ]
7
+
8
+ // This should not warn, either.
9
+ #[ allow( not_a_real_lint) ]
10
+ fn m ( ) { }
You can’t perform that action at this time.
0 commit comments