]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/imports/import.rs
Auto merge of #79780 - camelid:use-summary_opts, r=GuillaumeGomez
[rust.git] / src / test / ui / imports / import.rs
index de8bf62611416e101c15b69809add9e8702f4da4..3170dd2fae10824b9e338fc985ca203cd093909f 100644 (file)
@@ -1,12 +1,17 @@
-// run-pass
-mod foo {
-    pub fn x(y: isize) { println!("{}", y); }
-}
+use zed::bar;
+use zed::baz; //~ ERROR unresolved import `zed::baz` [E0432]
+              //~| no `baz` in `zed`
+              //~| HELP a similar name exists in the module
+              //~| SUGGESTION bar
+
 
-mod bar {
-    use foo::x;
-    use foo::x as z;
-    pub fn thing() { x(10); z(10); }
+mod zed {
+    pub fn bar() { println!("bar"); }
+    use foo; //~ ERROR unresolved import `foo` [E0432]
+             //~^ no `foo` in the root
 }
 
-pub fn main() { bar::thing(); }
+fn main() {
+    zed::foo(); //~ ERROR `foo` is private
+    bar();
+}