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