Implement crate level only lints checking.
This commit is contained in:
parent
59493917be
commit
f633dd385f
8 changed files with 148 additions and 11 deletions
|
|
@ -11,7 +11,7 @@
|
|||
// ignore-asmjs wasm2js does not support source maps yet
|
||||
|
||||
#![feature(non_ascii_idents)]
|
||||
#[allow(uncommon_codepoints)]
|
||||
#![allow(uncommon_codepoints)]
|
||||
|
||||
#[path = "issue-48508-aux.rs"]
|
||||
mod other_file;
|
||||
|
|
|
|||
22
src/test/ui/lint/crate_level_only_lint.rs
Normal file
22
src/test/ui/lint/crate_level_only_lint.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#![deny(uncommon_codepoints, unused_attributes)]
|
||||
|
||||
mod foo {
|
||||
#![allow(uncommon_codepoints)]
|
||||
//~^ ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
|
||||
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
|
||||
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
|
||||
|
||||
#[allow(uncommon_codepoints)]
|
||||
//~^ ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
|
||||
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
|
||||
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
|
||||
const BAR: f64 = 0.000001;
|
||||
|
||||
}
|
||||
|
||||
#[allow(uncommon_codepoints)]
|
||||
//~^ ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
|
||||
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
|
||||
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
|
||||
fn main() {
|
||||
}
|
||||
62
src/test/ui/lint/crate_level_only_lint.stderr
Normal file
62
src/test/ui/lint/crate_level_only_lint.stderr
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
error: allow(uncommon_codepoints) is ignored unless specified at crate level
|
||||
--> $DIR/crate_level_only_lint.rs:4:10
|
||||
|
|
||||
LL | #![allow(uncommon_codepoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/crate_level_only_lint.rs:1:30
|
||||
|
|
||||
LL | #![deny(uncommon_codepoints, unused_attributes)]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: allow(uncommon_codepoints) is ignored unless specified at crate level
|
||||
--> $DIR/crate_level_only_lint.rs:9:9
|
||||
|
|
||||
LL | #[allow(uncommon_codepoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: allow(uncommon_codepoints) is ignored unless specified at crate level
|
||||
--> $DIR/crate_level_only_lint.rs:17:9
|
||||
|
|
||||
LL | #[allow(uncommon_codepoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: allow(uncommon_codepoints) is ignored unless specified at crate level
|
||||
--> $DIR/crate_level_only_lint.rs:4:10
|
||||
|
|
||||
LL | #![allow(uncommon_codepoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: allow(uncommon_codepoints) is ignored unless specified at crate level
|
||||
--> $DIR/crate_level_only_lint.rs:9:9
|
||||
|
|
||||
LL | #[allow(uncommon_codepoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: allow(uncommon_codepoints) is ignored unless specified at crate level
|
||||
--> $DIR/crate_level_only_lint.rs:17:9
|
||||
|
|
||||
LL | #[allow(uncommon_codepoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: allow(uncommon_codepoints) is ignored unless specified at crate level
|
||||
--> $DIR/crate_level_only_lint.rs:4:10
|
||||
|
|
||||
LL | #![allow(uncommon_codepoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: allow(uncommon_codepoints) is ignored unless specified at crate level
|
||||
--> $DIR/crate_level_only_lint.rs:9:9
|
||||
|
|
||||
LL | #[allow(uncommon_codepoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: allow(uncommon_codepoints) is ignored unless specified at crate level
|
||||
--> $DIR/crate_level_only_lint.rs:17:9
|
||||
|
|
||||
LL | #[allow(uncommon_codepoints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue