fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
1.3 KiB45 linesraw
1error: expected identifier, found keyword `self`
2  --> $DIR/import-self.rs:9:12
3   |
4LL | use foo as self;
5   |            ^^^^ expected identifier, found keyword
6
7error[E0429]: `self` imports are only allowed within a { } list
8  --> $DIR/import-self.rs:12:5
9   |
10LL | use foo::self;
11   |     ^^^^^^^^^
12
13error[E0255]: the name `foo` is defined multiple times
14  --> $DIR/import-self.rs:6:11
15   |
16LL | mod foo {
17   | ------- previous definition of the module `foo` here
18...
19LL | use foo::{self};
20   |           ^^^^ `foo` reimported here
21   |
22   = note: `foo` must be defined only once in the type namespace of this module
23help: you can use `as` to change the binding name of the import
24   |
25LL | use foo::{self as other_foo};
26   |           ^^^^^^^^^^^^^^^^^
27
28error[E0252]: the name `A` is defined multiple times
29  --> $DIR/import-self.rs:16:11
30   |
31LL | use foo::A;
32   |     ------ previous import of the type `A` here
33LL | use foo::{self as A};
34   |           ^^^^^^^^^ `A` reimported here
35   |
36   = note: `A` must be defined only once in the type namespace of this module
37help: you can use `as` to change the binding name of the import
38   |
39LL | use foo::{self as OtherA};
40   |           ^^^^^^^^^^^^^^
41
42error: aborting due to 4 previous errors
43
44Some errors have detailed explanations: E0252, E0255, E0429.
45For more information about an error, try `rustc --explain E0252`.