about summary refs log tree commit diff
path: root/tests/ui/suggestions/unused-imports.fixed
blob: 57dd091c0436d8154d005421f2cc910d7b617d71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//@ 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;
    }
    pub mod another {
        pub struct H;
        pub struct I;
    }
}

use nested::B;
//~^ WARN unused import

use nested::even_more::F;
//~^^^^^^^ WARN unused import

// Note that the following fix should result in `::{self}`, not `::self`. The latter is invalid
// Rust syntax, so the braces should not be removed.
use nested::another::{self};
//~^ WARN unused import

fn main() {
    let _ = (B, F, another::I);
}