]> git.lizzy.rs Git - rust.git/blob - tests/target/imports.rs
fixup tests
[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 exceedingly::loooooooooooooooooooooooooooooooooooooooooooooooooooooooong::import::path::{ItemA,
8                                                                                              ItemB};
9 use exceedingly::looooooooooooooooooooooooooooooooooooooooooooooooooooooooooong::import::path::{ItemA,
10                                                                                                 ItemB};
11 use syntax::ast::{ItemDefaultImpl, ItemForeignMod, ItemImpl, ItemMac, ItemMod, ItemStatic};
12
13 use list::{// Another item
14            AnotherItem, // Another Comment
15            // Last Item
16            LastItem,
17            // Some item
18            SomeItem /* Comment */};
19
20 use test::{/* A */ self /* B */, Other /* C */};
21
22 use Foo::{Bar, Baz};
23 use syntax;
24 pub use syntax::ast::{Expr, ExprAssign, ExprCall, ExprMethodCall, ExprPath, Expr_};
25 use {Bar /* comment */, /* Pre-comment! */ Foo};
26
27 use self;
28 use std::io;
29 use std::io;
30
31 mod Foo {
32     pub use syntax::ast::{ItemDefaultImpl, ItemForeignMod, ItemImpl, ItemMac, ItemMod, ItemStatic};
33
34     mod Foo2 {
35         pub use syntax::ast::{self, ItemDefaultImpl, ItemForeignMod, ItemImpl, ItemMac, ItemMod,
36                               ItemStatic};
37     }
38 }
39
40 fn test() {
41     use Baz::*;
42     use Qux;
43 }
44
45 // Simple imports
46 use bar::quux as kaas;
47 use foo;
48 use foo::bar::baz;
49
50 // With aliases.
51 use foo as bar;
52 use foo::qux as bar;
53 use foo::{self as bar, baz};
54 use foo::{baz, qux as bar};
55
56 // With absolute paths
57 use Foo;
58 use foo;
59 use foo::Bar;
60 use foo::{Bar, Baz};
61 use {Bar, Baz};
62
63 // Root globs
64 use ::*;
65 use ::*;
66
67 // spaces used to cause glob imports to disappear (#1356)
68 use super::*;
69 use foo::issue_1356::*;
70
71 // We shouldn't remove imports which have attributes attached (#1858)
72 #[cfg(unix)]
73 use self::unix::{};
74
75 // nested imports
76 use foo::{a, b, boo, c,
77           bar::{baz, qux, xxxxxxxxxxx, yyyyyyyyyyyyy, zzzzzzzzzzzzzzzz,
78                 foo::{a, b, cxxxxxxxxxxxxx, yyyyyyyyyyyyyy, zzzzzzzzzzzzzzzz}}};
79
80 use fooo::{bar, x, y, z,
81            baar::foobar::{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
82                           zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz},
83            bar::*};
84
85 // nested imports with a single sub-tree.
86 use a::b::c::d;
87 use a::b::c::*;
88
89 use a::b::c::{xxx, yyy, zzz};