]> git.lizzy.rs Git - rust.git/blob - tests/target/imports.rs
make rustfmt-normalize_comments false by default
[rust.git] / tests / target / imports.rs
1 // rustfmt-normalize_comments: true
2
3 // Imports.
4
5 // Long import.
6 use syntax::ast::{ItemForeignMod, ItemImpl, ItemMac, ItemMod, ItemStatic, ItemDefaultImpl};
7 use exceedingly::looooooooooooooooooooooooooooooooooooooooooooooooooooooooooong::import::path::{ItemA,
8                                                                                                 ItemB};
9 use exceedingly::loooooooooooooooooooooooooooooooooooooooooooooooooooooooong::import::path::{ItemA,
10                                                                                              ItemB};
11
12 use list::{// Some item
13            SomeItem, // Comment
14            // Another item
15            AnotherItem, // Another Comment
16            // Last Item
17            LastItem};
18
19 use test::{/* A */ self /* B */, Other /* C */};
20
21 use syntax;
22 use {/* Pre-comment! */ Foo, Bar /* comment */};
23 use Foo::{Bar, Baz};
24 pub use syntax::ast::{Expr_, Expr, ExprAssign, ExprCall, ExprMethodCall, ExprPath};
25
26 use self;
27 use std::io;
28 use std::io;
29
30 mod Foo {
31     pub use syntax::ast::{ItemForeignMod, ItemImpl, ItemMac, ItemMod, ItemStatic, ItemDefaultImpl};
32
33     mod Foo2 {
34         pub use syntax::ast::{self, ItemForeignMod, ItemImpl, ItemMac, ItemMod, ItemStatic,
35                               ItemDefaultImpl};
36     }
37 }
38
39 fn test() {
40     use Baz::*;
41     use Qux;
42 }
43
44 // Simple imports
45 use foo::bar::baz;
46 use bar::quux as kaas;
47 use foo;
48
49 // With aliases.
50 use foo::{self as bar, baz};
51 use foo as bar;
52 use foo::qux as bar;
53 use foo::{baz, qux as bar};
54
55 // With absolute paths
56 use ::foo;
57 use ::foo::Bar;
58 use ::foo::{Bar, Baz};
59 use ::Foo;
60 use ::{Bar, Baz};