diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/imports/issue-45829/import-self.stderr | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/imports/issue-45829/import-self.stderr')
-rw-r--r-- | tests/ui/imports/issue-45829/import-self.stderr | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/ui/imports/issue-45829/import-self.stderr b/tests/ui/imports/issue-45829/import-self.stderr new file mode 100644 index 000000000..0c9424f30 --- /dev/null +++ b/tests/ui/imports/issue-45829/import-self.stderr @@ -0,0 +1,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`. |