]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/imports/issue-62767.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / imports / issue-62767.rs
index 984d3f0ca92f4a9fac073acc37eab85fe426609d..0e0f915ea53c20069e7fcbfea0b1d55922a15794 100644 (file)
@@ -1,5 +1,4 @@
-// check-pass
-
+// Minimized case from #62767.
 mod m {
     pub enum Same {
         Same,
@@ -8,8 +7,22 @@ mod m {
 
 use m::*;
 
-// The variant `Same` introduced by this import is not considered when resolving the prefix
-// `Same::` during import validation (issue #62767).
-use Same::Same;
+// 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`
+
+// Case from #74556.
+mod foo {
+    pub mod bar {
+        pub mod bar {
+            pub fn foobar() {}
+        }
+    }
+}
+
+use foo::*;
+use bar::bar; //~ ERROR unresolved import `bar::bar`
+              //~| ERROR inconsistent resolution for an import
+use bar::foobar;
 
 fn main() {}