-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #12285 - Ethiraric:fix-8573, r=dswij
Ignore imported items in `min_ident_chars` Suppress the `min_ident_chars` warning for items whose name we cannot control. Do not warn for `use a::b`, but warn for `use a::b as c`, since `c` is a local identifier. Fixes #12232 --- *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: [`min_ident_chars`]: Do not warn on non-local identifiers
- Loading branch information
Showing
4 changed files
with
58 additions
and
15 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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
#![allow(nonstandard_style, unused)] | ||
|
||
pub struct Aaa; | ||
pub struct Bbb; | ||
|
||
pub const N: u32 = 3; | ||
|
||
pub const M: u32 = 2; | ||
pub const LONGER: u32 = 32; |
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 |
---|---|---|
@@ -1,47 +1,53 @@ | ||
error: this ident is too short (3 <= 3) | ||
--> $DIR/min_ident_chars.rs:6:19 | ||
error: this ident is too short (1 <= 3) | ||
--> $DIR/min_ident_chars.rs:6:41 | ||
| | ||
LL | use extern_types::Aaa; | ||
| ^^^ | ||
LL | use extern_types::{Aaa, LONGER, M, N as W}; | ||
| ^ | ||
| | ||
= note: `-D clippy::min-ident-chars` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::min_ident_chars)]` | ||
|
||
error: this ident is too short (1 <= 3) | ||
--> $DIR/min_ident_chars.rs:8:11 | ||
| | ||
LL | pub const N: u32 = 0; | ||
| ^ | ||
|
||
error: this ident is too short (3 <= 3) | ||
--> $DIR/min_ident_chars.rs:10:5 | ||
--> $DIR/min_ident_chars.rs:13:5 | ||
| | ||
LL | aaa: Aaa, | ||
| ^^^ | ||
|
||
error: this ident is too short (3 <= 3) | ||
--> $DIR/min_ident_chars.rs:15:9 | ||
--> $DIR/min_ident_chars.rs:18:9 | ||
| | ||
LL | let vvv = 1; | ||
| ^^^ | ||
|
||
error: this ident is too short (3 <= 3) | ||
--> $DIR/min_ident_chars.rs:16:9 | ||
--> $DIR/min_ident_chars.rs:19:9 | ||
| | ||
LL | let uuu = 1; | ||
| ^^^ | ||
|
||
error: this ident is too short (1 <= 3) | ||
--> $DIR/min_ident_chars.rs:17:14 | ||
--> $DIR/min_ident_chars.rs:20:14 | ||
| | ||
LL | let (mut a, mut b) = (1, 2); | ||
| ^ | ||
|
||
error: this ident is too short (1 <= 3) | ||
--> $DIR/min_ident_chars.rs:17:21 | ||
--> $DIR/min_ident_chars.rs:20:21 | ||
| | ||
LL | let (mut a, mut b) = (1, 2); | ||
| ^ | ||
|
||
error: this ident is too short (1 <= 3) | ||
--> $DIR/min_ident_chars.rs:18:9 | ||
--> $DIR/min_ident_chars.rs:21:9 | ||
| | ||
LL | for i in 0..1000 {} | ||
| ^ | ||
|
||
error: aborting due to 7 previous errors | ||
error: aborting due to 8 previous errors | ||
|