-
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.
merge redundant import into unused import for suggesting removing
- Loading branch information
1 parent
1508a03
commit 2f8b7b7
Showing
25 changed files
with
244 additions
and
143 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
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
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,39 @@ | ||
//@ run-rustfix | ||
//@ compile-flags: --edition 2021 | ||
#![deny(unused_imports)] | ||
#![allow(dead_code)] | ||
|
||
fn test0() { | ||
// Test remove FlatUnused | ||
|
||
//~^ ERROR redundant import | ||
let _ = u32::try_from(5i32); | ||
} | ||
|
||
fn test1() { | ||
// Test remove NestedFullUnused | ||
|
||
//~^ ERROR redundant imports | ||
|
||
let _ = u32::try_from(5i32); | ||
let _a: i32 = u32::try_into(5u32).unwrap(); | ||
} | ||
|
||
fn test2() { | ||
// Test remove both redundant and unused | ||
|
||
//~^ ERROR unused or redundant imports: `AsMut`, `Into` | ||
|
||
let _a: u32 = (5u8).into(); | ||
} | ||
|
||
fn test3() { | ||
// Test remove NestedPartialUnused | ||
use std::convert::{Infallible}; | ||
//~^ ERROR unused import: `From` | ||
|
||
trait MyTrait {} | ||
impl MyTrait for fn() -> Infallible {} | ||
} | ||
|
||
fn main() {} |
Oops, something went wrong.