]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #34379 - liigo:patch-11, r=GuillaumeGomez
authorManish Goregaokar <manishsmail@gmail.com>
Sat, 25 Jun 2016 08:46:19 +0000 (14:16 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Sat, 25 Jun 2016 12:46:39 +0000 (18:16 +0530)
Improve diagnostics E0425: `use` (public) name

E0425: unresolved name

src/librustc_resolve/diagnostics.rs

index 208b5f11e20d125c4787cd1662898ae31d50718c..4e4f6e276d1ddfaac9e7f80e39fb4af483c7989d 100644 (file)
@@ -843,6 +843,17 @@ mod something_that_does_exist {
 let unknown_variable = 12u32;
 let x = unknown_variable; // ok!
 ```
+
+If the item is not defined in the current module, it must be imported using a
+`use` statement, like so:
+
+```ignore
+use foo::bar;
+bar();
+```
+
+If the item you are importing is not defined in some super-module of the
+current module, then it must also be declared as public (e.g., `pub fn`).
 "##,
 
 E0426: r##"