about summary refs log tree commit diff
path: root/tests/ui/suggestions/unused-imports.rs
blob: 5f9dd243bdd2a795e10664834730191049342739 (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
36
37
38
39
40
41
42
//@ 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::{A, B, C};
//~^ WARN unused import

use nested::{
    D,
    even_more::{
        E,
        F,
        G,
                         },
            };
//~^^^^^^^ 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, I};
//~^ WARN unused import

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