-
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.
Do not ignore path segments in the middle in
#[allow]
/#[warn]
/`#[…
…deny]`/`#[forbid]` attributes
- Loading branch information
hyd-dev
committed
Apr 10, 2021
1 parent
e43c200
commit 56fe372
Showing
3 changed files
with
84 additions
and
43 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
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,16 @@ | ||
// check-pass | ||
#![warn(rustc::internal)] | ||
|
||
#[allow(rustc::foo::bar::default_hash_types)] | ||
//~^ WARN unknown lint: `rustc::foo::bar::default_hash_types` | ||
//~| HELP did you mean | ||
//~| SUGGESTION rustc::default_hash_types | ||
#[allow(rustc::foo::default_hash_types)] | ||
//~^ WARN unknown lint: `rustc::foo::default_hash_types` | ||
//~| HELP did you mean | ||
//~| SUGGESTION rustc::default_hash_types | ||
fn main() { | ||
let _ = std::collections::HashMap::<String, String>::new(); | ||
//~^ WARN Prefer FxHashMap over HashMap, it has better performance | ||
//~| HELP use | ||
} |
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,30 @@ | ||
warning: unknown lint: `rustc::foo::bar::default_hash_types` | ||
--> $DIR/issue-83477.rs:4:9 | ||
| | ||
LL | #[allow(rustc::foo::bar::default_hash_types)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `rustc::default_hash_types` | ||
| | ||
= note: `#[warn(unknown_lints)]` on by default | ||
|
||
warning: unknown lint: `rustc::foo::default_hash_types` | ||
--> $DIR/issue-83477.rs:8:9 | ||
| | ||
LL | #[allow(rustc::foo::default_hash_types)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `rustc::default_hash_types` | ||
|
||
warning: Prefer FxHashMap over HashMap, it has better performance | ||
--> $DIR/issue-83477.rs:13:31 | ||
| | ||
LL | let _ = std::collections::HashMap::<String, String>::new(); | ||
| ^^^^^^^ help: use: `FxHashMap` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/issue-83477.rs:2:9 | ||
| | ||
LL | #![warn(rustc::internal)] | ||
| ^^^^^^^^^^^^^^^ | ||
= note: `#[warn(rustc::default_hash_types)]` implied by `#[warn(rustc::internal)]` | ||
= note: a `use rustc_data_structures::fx::FxHashMap` may be necessary | ||
|
||
warning: 3 warnings emitted | ||
|