diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-11-25 04:25:59 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-11-25 16:41:16 +0300 |
| commit | e593431bc7f3ad89aea8e792384d6719bf60f3f3 (patch) | |
| tree | 8563a16bf6533cd5b1fb1237683d84e4f1a80148 /src/test/ui | |
| parent | d4a78da543fd8959edf386602537bece057a3918 (diff) | |
| download | rust-e593431bc7f3ad89aea8e792384d6719bf60f3f3.tar.gz rust-e593431bc7f3ad89aea8e792384d6719bf60f3f3.zip | |
resolve: Fix bad span arithmetics in import conflict diagnostics
Diffstat (limited to 'src/test/ui')
| -rw-r--r-- | src/test/ui/issues/issue-45829/import-self.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-45829/import-self.stderr | 20 |
2 files changed, 20 insertions, 3 deletions
diff --git a/src/test/ui/issues/issue-45829/import-self.rs b/src/test/ui/issues/issue-45829/import-self.rs index 8b13ffd0076..eb5fb458d82 100644 --- a/src/test/ui/issues/issue-45829/import-self.rs +++ b/src/test/ui/issues/issue-45829/import-self.rs @@ -19,4 +19,7 @@ use foo as self; use foo::self; +use foo::A; +use foo::{self as A}; + fn main() {} diff --git a/src/test/ui/issues/issue-45829/import-self.stderr b/src/test/ui/issues/issue-45829/import-self.stderr index 985dc4e7131..55e51952a88 100644 --- a/src/test/ui/issues/issue-45829/import-self.stderr +++ b/src/test/ui/issues/issue-45829/import-self.stderr @@ -25,7 +25,21 @@ help: you can use `as` to change the binding name of the import LL | use foo::{self as other_foo}; | ^^^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error[E0252]: the name `A` is defined multiple times + --> $DIR/import-self.rs:23: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 4 previous errors -Some errors occurred: E0255, E0429. -For more information about an error, try `rustc --explain E0255`. +Some errors occurred: E0252, E0255, E0429. +For more information about an error, try `rustc --explain E0252`. |
