-
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.
remove braces when fixing a nested use tree into a single use
- Loading branch information
1 parent
7357c8a
commit 47788ff
Showing
5 changed files
with
104 additions
and
2 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
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 @@ | ||
//@ run-rustfix | ||
//@ check-pass | ||
|
||
#![warn(unused_imports)] | ||
|
||
pub mod nested { | ||
pub struct A; | ||
pub struct B; | ||
pub struct C; | ||
pub struct D; | ||
pub mod even_more { | ||
pub struct E; | ||
pub struct F; | ||
pub struct G; | ||
} | ||
} | ||
|
||
use nested::B; | ||
//~^ WARN unused import | ||
|
||
use nested::even_more::F; | ||
//~^^^^^^^ WARN unused import | ||
|
||
fn main() { | ||
let _ = (B, F); | ||
} |
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,33 @@ | ||
//@ run-rustfix | ||
//@ check-pass | ||
|
||
#![warn(unused_imports)] | ||
|
||
pub mod nested { | ||
pub struct A; | ||
pub struct B; | ||
pub struct C; | ||
pub struct D; | ||
pub mod even_more { | ||
pub struct E; | ||
pub struct F; | ||
pub struct G; | ||
} | ||
} | ||
|
||
use nested::{A, B, C}; | ||
//~^ WARN unused import | ||
|
||
use nested::{ | ||
D, | ||
even_more::{ | ||
E, | ||
F, | ||
G, | ||
}, | ||
}; | ||
//~^^^^^^^ WARN unused import | ||
|
||
fn main() { | ||
let _ = (B, F); | ||
} |
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 @@ | ||
warning: unused imports: `A`, `C` | ||
--> $DIR/unused-imports.rs:18:14 | ||
| | ||
LL | use nested::{A, B, C}; | ||
| ^ ^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/unused-imports.rs:4:9 | ||
| | ||
LL | #![warn(unused_imports)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
warning: unused imports: `D`, `E`, `G` | ||
--> $DIR/unused-imports.rs:22:5 | ||
| | ||
LL | D, | ||
| ^ | ||
LL | even_more::{ | ||
LL | E, | ||
| ^ | ||
LL | F, | ||
LL | G, | ||
| ^ | ||
|
||
warning: 2 warnings emitted | ||
|