-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for unknown_lints from another file.
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// check-pass | ||
|
||
// Tests that the unknown_lints lint doesn't fire for an unknown lint loaded from a separate file. | ||
// The key part is that the stderr output should be empty. | ||
// Reported in https://github.com/rust-lang/rust/issues/84936 | ||
// Fixed incidentally by https://github.com/rust-lang/rust/pull/97266 | ||
|
||
// This `allow` should apply to submodules, whether they are inline or loaded from a file. | ||
#![allow(unknown_lints)] | ||
#![allow(dead_code)] | ||
// no warning | ||
#![allow(not_a_real_lint)] | ||
|
||
mod other; | ||
|
||
// no warning | ||
#[allow(not_a_real_lint)] | ||
fn m() {} | ||
|
||
mod mm { | ||
// no warning | ||
#[allow(not_a_real_lint)] | ||
fn m() {} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// ignore-test | ||
|
||
// Companion to allow-in-other-module.rs | ||
|
||
// This should not warn. | ||
#![allow(not_a_real_lint)] | ||
|
||
// This should not warn, either. | ||
#[allow(not_a_real_lint)] | ||
fn m() {} |