blob: 0c9424f308351905939a9bd1e3cfcd6705bcbbe6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
error: expected identifier, found keyword `self`
--> $DIR/import-self.rs:9:12
|
LL | use foo as self;
| ^^^^ expected identifier, found keyword
error[E0429]: `self` imports are only allowed within a { } list
--> $DIR/import-self.rs:12:8
|
LL | use foo::self;
| ^^^^^^
|
help: consider importing the module directly
|
LL - use foo::self;
LL + use foo;
|
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::{self};
| + +
error[E0255]: the name `foo` is defined multiple times
--> $DIR/import-self.rs:6:11
|
LL | mod foo {
| ------- previous definition of the module `foo` here
...
LL | use foo::{self};
| ^^^^ `foo` reimported here
|
= note: `foo` must be defined only once in the type namespace of this module
help: you can use `as` to change the binding name of the import
|
LL | use foo::{self as other_foo};
| ~~~~~~~~~~~~~~~~~
error[E0255]: the name `foo` is defined multiple times
--> $DIR/import-self.rs:12:5
|
LL | mod foo {
| ------- previous definition of the module `foo` here
...
LL | use foo::self;
| ^^^^^^^^^ `foo` reimported here
|
= note: `foo` must be defined only once in the type namespace of this module
help: you can use `as` to change the binding name of the import
|
LL | use foo as other_foo;
| ~~~~~~~~~~~~~~~~
error[E0252]: the name `A` is defined multiple times
--> $DIR/import-self.rs:16:11
|
LL | use foo::A;
| ------ previous import of the type `A` here
LL | use foo::{self as A};
| ^^^^^^^^^ `A` reimported here
|
= note: `A` must be defined only once in the type namespace of this module
help: you can use `as` to change the binding name of the import
|
LL | use foo::{self as OtherA};
| ~~~~~~~~~~~~~~
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0252, E0255, E0429.
For more information about an error, try `rustc --explain E0252`.
|