1+ // rustfmt-normalize_comments: true
2+ // rustfmt-edition: 2015
3+
4+ // Imports.
5+
6+ // Long import.
7+ use syntax:: ast:: { ItemForeignMod , ItemImpl , ItemMac , ItemMod , ItemStatic , ItemDefaultImpl } ;
8+ use exceedingly:: looooooooooooooooooooooooooooooooooooooooooooooooooooooooooong:: import:: path:: { ItemA , ItemB } ;
9+ use exceedingly:: loooooooooooooooooooooooooooooooooooooooooooooooooooooooong:: import:: path:: { ItemA , ItemB } ;
10+
11+ use list:: {
12+ // Some item
13+ SomeItem /* Comment */ , /* Another item */ AnotherItem /* Another Comment */ , // Last Item
14+ LastItem
15+ } ;
16+
17+ use test:: { Other /* C */ , /* A */ self /* B */ } ;
18+
19+ use syntax:: { self } ;
20+ use { /* Pre-comment! */
21+ Foo , Bar /* comment */ } ;
22+ use Foo :: { Bar , Baz } ;
23+ pub use syntax:: ast:: { Expr_ , Expr , ExprAssign , ExprCall , ExprMethodCall , ExprPath } ;
24+
25+ use syntax:: some:: { } ;
26+
27+ use self ;
28+ use std:: io:: { self } ;
29+ use std:: io:: self;
30+
31+ mod Foo {
32+ pub use syntax:: ast:: {
33+ ItemForeignMod ,
34+ ItemImpl ,
35+ ItemMac ,
36+ ItemMod ,
37+ ItemStatic ,
38+ ItemDefaultImpl
39+ } ;
40+
41+ mod Foo2 {
42+ pub use syntax:: ast:: { ItemForeignMod , ItemImpl , ItemMac , ItemMod , ItemStatic , self , ItemDefaultImpl } ;
43+ }
44+ }
45+
46+ fn test ( ) {
47+ use Baz :: * ;
48+ use Qux ;
49+ }
50+
51+ // Simple imports
52+ use foo:: bar:: baz as baz ;
53+ use bar:: quux as kaas;
54+ use foo;
55+
56+ // With aliases.
57+ use foo:: { self as bar, baz} ;
58+ use foo:: { self as bar} ;
59+ use foo:: { qux as bar} ;
60+ use foo:: { baz, qux as bar} ;
61+
62+ // With absolute paths
63+ use :: foo;
64+ use :: foo:: { Bar } ;
65+ use :: foo:: { Bar , Baz } ;
66+ use :: { Foo } ;
67+ use :: { Bar , Baz } ;
68+
69+ // Root globs
70+ use * ;
71+ use :: * ;
72+
73+ // spaces used to cause glob imports to disappear (#1356)
74+ use super :: * ;
75+ use foo:: issue_1356:: * ;
76+
77+ // We shouldn't remove imports which have attributes attached (#1858)
78+ #[ cfg( unix) ]
79+ use self :: unix:: { } ;
80+
81+ // nested imports
82+ use foo:: { a, bar:: { baz, qux, xxxxxxxxxxx, yyyyyyyyyyyyy, zzzzzzzzzzzzzzzz, foo:: { a, b, cxxxxxxxxxxxxx, yyyyyyyyyyyyyy, zzzzzzzzzzzzzzzz} } , b, boo, c, } ;
83+
84+ use fooo:: { baar:: { foobar:: { xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz} } , z, bar, bar:: * , x, y} ;
85+
86+ use exonum:: { api:: { Api , ApiError } , blockchain:: { self , BlockProof , Blockchain , Transaction , TransactionSet } , crypto:: { Hash , PublicKey } , helpers:: Height , node:: TransactionSend , storage:: { ListProof , MapProof } } ;
87+
88+ // nested imports with a single sub-tree.
89+ use a:: { b:: { c:: * } } ;
90+ use a:: { b:: { c:: { } } } ;
91+ use a:: { b:: { c:: d} } ;
92+ use a:: { b:: { c:: { xxx, yyy, zzz} } } ;
93+
94+ // #2645
95+ /// This line is not affected.
96+ // This line is deleted.
97+ use c;
98+
99+ // #2670
100+ #[ macro_use]
101+ use imports_with_attr;
102+
103+ // #2888
104+ use std:: f64:: consts:: { SQRT_2 , E , PI } ;
105+
106+ // #3273
107+ #[ rustfmt:: skip]
108+ use std:: fmt:: { self , { Display , Formatter } } ;
0 commit comments