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