summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/5131_module.rs
blob: 3e9139177c56ed5df57c2aeb1d73985344581687 (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
// rustfmt-imports_granularity: Module

#![allow(dead_code)]

mod a {
    pub mod b {
        pub struct Data {
            pub a: i32,
        }
    }

    use crate::a::b::Data;
    use crate::a::b::Data as Data2;

    pub fn data(a: i32) -> Data {
        Data { a }
    }

    pub fn data2(a: i32) -> Data2 {
        Data2 { a }
    }

    #[cfg(test)]
    mod tests {
        use super::*;

        #[test]
        pub fn test() {
            data(1);
            data2(1);
        }
    }
}