about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-11-07 21:57:02 +0000
committerbors <bors@rust-lang.org>2020-11-07 21:57:02 +0000
commit771cc7ffc35b832bf35fecb22860eabb70c91da5 (patch)
tree7b4a8c12c5a49cf83828cd3a77a490c78e8df6fe /src
parentb2d115f6db5172c961dfeb50de15f35784dbc7c9 (diff)
parentae4f80b4beb67101708a6bf5646dd159ad33318c (diff)
downloadrust-771cc7ffc35b832bf35fecb22860eabb70c91da5.tar.gz
rust-771cc7ffc35b832bf35fecb22860eabb70c91da5.zip
Auto merge of #78784 - Mark-Simulacrum:revert-77421, r=petrochenkov
Revert "Revert "resolve: Avoid "self-confirming" import resolutions in one more case""

Specifically, this reverts commit b20bce8ce54ea9d47c2e3eb0b17cbb6baf916ae2 from #77421 to fix #77586.

The lang team has decided that for the time being we want to avoid the breakage here (perhaps for a future edition; though almost certainly not the upcoming one), though a future PR may want to add a lint around this case (and perhaps others) which are unlikely to be readable code.

r? `@petrochenkov` to confirm this is the right way to fix #77586.
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/imports/issue-62767.rs8
-rw-r--r--src/test/ui/imports/issue-62767.stderr21
2 files changed, 5 insertions, 24 deletions
diff --git a/src/test/ui/imports/issue-62767.rs b/src/test/ui/imports/issue-62767.rs
index 0e0f915ea53..01184eea9b4 100644
--- a/src/test/ui/imports/issue-62767.rs
+++ b/src/test/ui/imports/issue-62767.rs
@@ -1,3 +1,5 @@
+// check-pass
+
 // Minimized case from #62767.
 mod m {
     pub enum Same {
@@ -9,7 +11,7 @@ use m::*;
 
 // The variant `Same` introduced by this import is also considered when resolving the prefix
 // `Same::` during import validation to avoid effects similar to time travel (#74556).
-use Same::Same; //~ ERROR unresolved import `Same`
+use Same::Same;
 
 // Case from #74556.
 mod foo {
@@ -21,8 +23,8 @@ mod foo {
 }
 
 use foo::*;
-use bar::bar; //~ ERROR unresolved import `bar::bar`
-              //~| ERROR inconsistent resolution for an import
+use bar::bar;
+
 use bar::foobar;
 
 fn main() {}
diff --git a/src/test/ui/imports/issue-62767.stderr b/src/test/ui/imports/issue-62767.stderr
deleted file mode 100644
index a4334bda6dd..00000000000
--- a/src/test/ui/imports/issue-62767.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error: inconsistent resolution for an import
-  --> $DIR/issue-62767.rs:24:5
-   |
-LL | use bar::bar;
-   |     ^^^^^^^^
-
-error[E0432]: unresolved import `Same`
-  --> $DIR/issue-62767.rs:12:5
-   |
-LL | use Same::Same;
-   |     ^^^^ `Same` is a variant, not a module
-
-error[E0432]: unresolved import `bar::bar`
-  --> $DIR/issue-62767.rs:24:5
-   |
-LL | use bar::bar;
-   |     ^^^^^^^^ no `bar` in `foo::bar::bar`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0432`.