rust/tests/ui/imports/issue-45829/import-self.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

71 lines
2.0 KiB
Plaintext
Raw Normal View History

error: expected identifier, found keyword `self`
2018-12-25 09:56:47 -06:00
--> $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
2020-05-03 11:54:21 -05:00
--> $DIR/import-self.rs:12:8
|
LL | use foo::self;
2020-05-03 11:54:21 -05:00
| ^^^^^^
|
2020-05-19 15:12:41 -05:00
help: consider importing the module directly
2020-05-03 11:54:21 -05:00
|
LL - use foo::self;
LL + use foo;
2022-06-08 12:34:57 -05:00
|
2020-05-19 15:12:41 -05:00
help: alternatively, use the multi-path `use` syntax to import `self`
2020-05-03 11:54:21 -05:00
|
LL | use foo::{self};
| + +
error[E0255]: the name `foo` is defined multiple times
2018-12-25 09:56:47 -06:00
--> $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};
| ~~~~~~~~~~~~~~~~~
2020-05-03 11:56:52 -05:00
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;
| ~~~~~~~~~~~~~~~~
2020-05-03 11:56:52 -05:00
error[E0252]: the name `A` is defined multiple times
2018-12-25 09:56:47 -06:00
--> $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};
| ~~~~~~~~~~~~~~
2020-05-03 11:56:52 -05:00
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`.