]> git.lizzy.rs Git - rust.git/commitdiff
Update E0659 error code long explanation to 2018 edition
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Tue, 22 Oct 2019 09:52:05 +0000 (11:52 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Tue, 22 Oct 2019 09:52:05 +0000 (11:52 +0200)
src/librustc_resolve/error_codes.rs

index 8ccb27078d5696e015854227a599f6440e6b9cd6..a7a3d71b5395d00e2b3db3aff0591c536ffe4f5c 100644 (file)
@@ -1822,7 +1822,7 @@ mod SomeModule {
 
 Erroneous code example:
 
-```compile_fail,E0659
+```compile_fail,edition2018,E0659
 pub mod moon {
     pub fn foo() {}
 }
@@ -1832,12 +1832,12 @@ pub fn foo() {}
 }
 
 mod collider {
-    pub use moon::*;
-    pub use earth::*;
+    pub use crate::moon::*;
+    pub use crate::earth::*;
 }
 
 fn main() {
-    collider::foo(); // ERROR: `foo` is ambiguous
+    crate::collider::foo(); // ERROR: `foo` is ambiguous
 }
 ```
 
@@ -1849,7 +1849,7 @@ fn main() {
 To solve this error, the best solution is generally to keep the path before the
 item when using it. Example:
 
-```
+```edition2018
 pub mod moon {
     pub fn foo() {}
 }
@@ -1859,13 +1859,13 @@ pub fn foo() {}
 }
 
 mod collider {
-    pub use moon;
-    pub use earth;
+    pub use crate::moon;
+    pub use crate::earth;
 }
 
 fn main() {
-    collider::moon::foo(); // ok!
-    collider::earth::foo(); // ok!
+    crate::collider::moon::foo(); // ok!
+    crate::collider::earth::foo(); // ok!
 }
 ```
 "##,