]> git.lizzy.rs Git - rust.git/commitdiff
resolve: Suggest `crate::` for resolving ambiguities when appropriate
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Sun, 25 Nov 2018 13:08:43 +0000 (16:08 +0300)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Mon, 26 Nov 2018 21:34:25 +0000 (00:34 +0300)
More precise spans for ambiguities from macros

16 files changed:
src/librustc_resolve/lib.rs
src/librustc_resolve/macros.rs
src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import-ambig.stderr
src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.stderr
src/test/ui-fulldeps/proc-macro/derive-helper-shadowing.stderr
src/test/ui/editions/edition-imports-virtual-2015-ambiguity.rs
src/test/ui/editions/edition-imports-virtual-2015-ambiguity.stderr
src/test/ui/imports/local-modularized-tricky-fail-1.rs
src/test/ui/imports/local-modularized-tricky-fail-1.stderr
src/test/ui/imports/macro-paths.stderr
src/test/ui/macros/restricted-shadowing-legacy.stderr
src/test/ui/macros/restricted-shadowing-modern.stderr
src/test/ui/rust-2018/uniform-paths/ambiguity-macros.stderr
src/test/ui/rust-2018/uniform-paths/ambiguity.stderr
src/test/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr
src/test/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr

index 0be9881f910b78f0fede1bfcbefe59583ebed486..cbf82a80266678f72d33557103e7ab90de619c92 100644 (file)
@@ -1292,6 +1292,7 @@ fn descr(self) -> &'static str {
 /// Miscellaneous bits of metadata for better ambiguity error reporting.
 #[derive(Clone, Copy, PartialEq)]
 enum AmbiguityErrorMisc {
+    SuggestCrate,
     SuggestSelf,
     FromPrelude,
     None,
@@ -4870,12 +4871,21 @@ fn report_ambiguity_error(&self, ambiguity_error: &AmbiguityError) {
                                         `{ident}` to disambiguate", ident = ident))
             }
             if b.is_extern_crate() && ident.span.rust_2018() {
-                help_msgs.push(format!("use `::{ident}` to refer to this {thing} unambiguously",
-                                       ident = ident, thing = b.descr()))
-            }
-            if misc == AmbiguityErrorMisc::SuggestSelf {
-                help_msgs.push(format!("use `self::{ident}` to refer to this {thing} unambiguously",
-                                       ident = ident, thing = b.descr()))
+                help_msgs.push(format!(
+                    "use `::{ident}` to refer to this {thing} unambiguously",
+                    ident = ident, thing = b.descr(),
+                ))
+            }
+            if misc == AmbiguityErrorMisc::SuggestCrate {
+                help_msgs.push(format!(
+                    "use `crate::{ident}` to refer to this {thing} unambiguously",
+                    ident = ident, thing = b.descr(),
+                ))
+            } else if misc == AmbiguityErrorMisc::SuggestSelf {
+                help_msgs.push(format!(
+                    "use `self::{ident}` to refer to this {thing} unambiguously",
+                    ident = ident, thing = b.descr(),
+                ))
             }
 
             if b.span.is_dummy() {
index d306e9ebe32b5f3222fd6eb9c93bcabfac66b25b..5db3efee9f6a15ebc724b313998b73a9eea77f10 100644 (file)
@@ -42,7 +42,7 @@
 use errors::Applicability;
 
 use std::cell::Cell;
-use std::mem;
+use std::{mem, ptr};
 use rustc_data_structures::sync::Lrc;
 
 #[derive(Clone, Debug)]
@@ -594,11 +594,12 @@ enum WhereToResolve<'a> {
 
         bitflags! {
             struct Flags: u8 {
-                const MACRO_RULES       = 1 << 0;
-                const MODULE            = 1 << 1;
-                const PRELUDE           = 1 << 2;
-                const MISC_SUGGEST_SELF = 1 << 3;
-                const MISC_FROM_PRELUDE = 1 << 4;
+                const MACRO_RULES        = 1 << 0;
+                const MODULE             = 1 << 1;
+                const PRELUDE            = 1 << 2;
+                const MISC_SUGGEST_CRATE = 1 << 3;
+                const MISC_SUGGEST_SELF  = 1 << 4;
+                const MISC_FROM_PRELUDE  = 1 << 5;
             }
         }
 
@@ -684,7 +685,7 @@ struct Flags: u8 {
                         path_span,
                     );
                     match binding {
-                        Ok(binding) => Ok((binding, Flags::MODULE)),
+                        Ok(binding) => Ok((binding, Flags::MODULE | Flags::MISC_SUGGEST_CRATE)),
                         Err((Determinacy::Undetermined, Weak::No)) =>
                             return Err(Determinacy::determined(force)),
                         Err((Determinacy::Undetermined, Weak::Yes)) =>
@@ -706,7 +707,9 @@ struct Flags: u8 {
                     self.current_module = orig_current_module;
                     match binding {
                         Ok(binding) => {
-                            let misc_flags = if module.is_normal() {
+                            let misc_flags = if ptr::eq(module, self.graph_root) {
+                                Flags::MISC_SUGGEST_CRATE
+                            } else if module.is_normal() {
                                 Flags::MISC_SUGGEST_SELF
                             } else {
                                 Flags::empty()
@@ -857,7 +860,9 @@ struct Flags: u8 {
                                 None
                             };
                             if let Some(kind) = ambiguity_error_kind {
-                                let misc = |f: Flags| if f.contains(Flags::MISC_SUGGEST_SELF) {
+                                let misc = |f: Flags| if f.contains(Flags::MISC_SUGGEST_CRATE) {
+                                    AmbiguityErrorMisc::SuggestCrate
+                                } else if f.contains(Flags::MISC_SUGGEST_SELF) {
                                     AmbiguityErrorMisc::SuggestSelf
                                 } else if f.contains(Flags::MISC_FROM_PRELUDE) {
                                     AmbiguityErrorMisc::FromPrelude
@@ -866,7 +871,7 @@ struct Flags: u8 {
                                 };
                                 self.ambiguity_errors.push(AmbiguityError {
                                     kind,
-                                    ident,
+                                    ident: orig_ident,
                                     b1: innermost_binding,
                                     b2: binding,
                                     misc1: misc(innermost_flags),
index ee98873064fc4a6253c7a348337cf31a5456ad23..d288d7295120cfc11aea7ef3f51642e22098b3dd 100644 (file)
@@ -14,7 +14,7 @@ note: `helper` could also refer to the attribute macro imported here
    |
 LL | use plugin::helper;
    |     ^^^^^^^^^^^^^^
-   = help: use `self::helper` to refer to this attribute macro unambiguously
+   = help: use `crate::helper` to refer to this attribute macro unambiguously
 
 error: aborting due to previous error
 
index 34b21ea26830c1e7458722e7e9486bb29aeac167..79dc922b9db2cc8e95ea9519eb214f246489c9dc 100644 (file)
@@ -16,7 +16,7 @@ note: `repr` could also refer to the attribute macro imported here
    |
 LL | use builtin_attrs::*;
    |     ^^^^^^^^^^^^^^^^
-   = help: use `self::repr` to refer to this attribute macro unambiguously
+   = help: use `crate::repr` to refer to this attribute macro unambiguously
 
 error[E0659]: `repr` is ambiguous (built-in attribute vs any other name)
   --> $DIR/ambiguous-builtin-attrs.rs:11:19
@@ -30,7 +30,7 @@ note: `repr` could also refer to the attribute macro imported here
    |
 LL | use builtin_attrs::*;
    |     ^^^^^^^^^^^^^^^^
-   = help: use `self::repr` to refer to this attribute macro unambiguously
+   = help: use `crate::repr` to refer to this attribute macro unambiguously
 
 error[E0659]: `repr` is ambiguous (built-in attribute vs any other name)
   --> $DIR/ambiguous-builtin-attrs.rs:20:34
@@ -44,7 +44,7 @@ note: `repr` could also refer to the attribute macro imported here
    |
 LL | use builtin_attrs::*;
    |     ^^^^^^^^^^^^^^^^
-   = help: use `self::repr` to refer to this attribute macro unambiguously
+   = help: use `crate::repr` to refer to this attribute macro unambiguously
 
 error[E0659]: `repr` is ambiguous (built-in attribute vs any other name)
   --> $DIR/ambiguous-builtin-attrs.rs:22:11
@@ -58,7 +58,7 @@ note: `repr` could also refer to the attribute macro imported here
    |
 LL | use builtin_attrs::*;
    |     ^^^^^^^^^^^^^^^^
-   = help: use `self::repr` to refer to this attribute macro unambiguously
+   = help: use `crate::repr` to refer to this attribute macro unambiguously
 
 error[E0659]: `feature` is ambiguous (built-in attribute vs any other name)
   --> $DIR/ambiguous-builtin-attrs.rs:3:4
@@ -72,7 +72,7 @@ note: `feature` could also refer to the attribute macro imported here
    |
 LL | use builtin_attrs::*;
    |     ^^^^^^^^^^^^^^^^
-   = help: use `self::feature` to refer to this attribute macro unambiguously
+   = help: use `crate::feature` to refer to this attribute macro unambiguously
 
 error: aborting due to 6 previous errors
 
index f04782fac4d2d6d9b5ca44075f9d3d8493c23580..cc50fefc46453d393defc7bfb7ba3dbc691deed7 100644 (file)
@@ -14,7 +14,7 @@ note: `my_attr` could also refer to the attribute macro imported here
    |
 LL | use derive_helper_shadowing::*;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = help: use `self::my_attr` to refer to this attribute macro unambiguously
+   = help: use `crate::my_attr` to refer to this attribute macro unambiguously
 
 error: aborting due to previous error
 
index 562d3c9e70fb1153d392469a43a50dfdc76dab98..53ec3867f0110966c1fbdd82e70782489383ed7d 100644 (file)
@@ -1,8 +1,6 @@
 // edition:2018
 // compile-flags:--extern edition_imports_2015
 // aux-build:edition-imports-2015.rs
-// error-pattern: `Ambiguous` is ambiguous
-// error-pattern: `edition_imports_2015` is ambiguous
 
 mod edition_imports_2015 {
     pub struct Path;
@@ -14,7 +12,8 @@ mod check {
     pub struct Ambiguous {}
 
     fn check() {
-        edition_imports_2015::gen_ambiguous!();
+        edition_imports_2015::gen_ambiguous!(); //~ ERROR `Ambiguous` is ambiguous
+                                                //~| ERROR `edition_imports_2015` is ambiguous
     }
 }
 
index d0897d081c3574c7112aa9ee60c7841a89a97379..ac2bf21c5c0ba95ee157ebd0ed9fc939ee9d3451 100644 (file)
@@ -1,36 +1,39 @@
 error[E0659]: `Ambiguous` is ambiguous (name vs any other name during import resolution)
-  --> <::edition_imports_2015::gen_ambiguous macros>:1:15
+  --> $DIR/edition-imports-virtual-2015-ambiguity.rs:15:9
    |
-LL | (  ) => { use Ambiguous ; type A = :: edition_imports_2015 :: Path ; }
-   |               ^^^^^^^^^ ambiguous name
+LL |         edition_imports_2015::gen_ambiguous!(); //~ ERROR `Ambiguous` is ambiguous
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous name
    |
 note: `Ambiguous` could refer to the struct defined here
-  --> $DIR/edition-imports-virtual-2015-ambiguity.rs:11:1
+  --> $DIR/edition-imports-virtual-2015-ambiguity.rs:9:1
    |
 LL | pub struct Ambiguous {}
    | ^^^^^^^^^^^^^^^^^^^^^^^
+   = help: use `crate::Ambiguous` to refer to this struct unambiguously
 note: `Ambiguous` could also refer to the struct defined here
-  --> $DIR/edition-imports-virtual-2015-ambiguity.rs:14:5
+  --> $DIR/edition-imports-virtual-2015-ambiguity.rs:12:5
    |
 LL |     pub struct Ambiguous {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^
    = help: use `self::Ambiguous` to refer to this struct unambiguously
+   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
 error[E0659]: `edition_imports_2015` is ambiguous (name in the crate root vs extern crate during absolute path resolution)
-  --> <::edition_imports_2015::gen_ambiguous macros>:1:39
+  --> $DIR/edition-imports-virtual-2015-ambiguity.rs:15:9
    |
-LL | (  ) => { use Ambiguous ; type A = :: edition_imports_2015 :: Path ; }
-   |                                       ^^^^^^^^^^^^^^^^^^^^ ambiguous name
+LL |         edition_imports_2015::gen_ambiguous!(); //~ ERROR `Ambiguous` is ambiguous
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous name
    |
    = note: `edition_imports_2015` could refer to an extern crate passed with `--extern`
-   = help: use `::edition_imports_2015` to refer to this extern crate unambiguously
 note: `edition_imports_2015` could also refer to the module defined here
-  --> $DIR/edition-imports-virtual-2015-ambiguity.rs:7:1
+  --> $DIR/edition-imports-virtual-2015-ambiguity.rs:5:1
    |
 LL | / mod edition_imports_2015 {
 LL | |     pub struct Path;
 LL | | }
    | |_^
+   = help: use `crate::edition_imports_2015` to refer to this module unambiguously
+   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
 error: aborting due to 2 previous errors
 
index fb05b95a96dc621bde8238c8ce3788dafd2b4752..37633c7a4415f0579542640f9629b71c1fd6c199 100644 (file)
@@ -43,6 +43,7 @@ mod inner2 {
 
 fn main() {
     panic!(); //~ ERROR `panic` is ambiguous
+              //~| ERROR `panic` is ambiguous
 }
 
 mod inner3 {
index 962294e48caef9a999dca37758ad41412915d3d4..1978648e206f123c5ef08f04145ded69f1f0fc7d 100644 (file)
@@ -22,7 +22,7 @@ LL | use inner1::*;
    = help: consider adding an explicit import of `exported` to disambiguate
 
 error[E0659]: `include` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
-  --> $DIR/local-modularized-tricky-fail-1.rs:56:1
+  --> $DIR/local-modularized-tricky-fail-1.rs:57:1
    |
 LL | include!(); //~ ERROR `include` is ambiguous
    | ^^^^^^^ ambiguous name
@@ -38,7 +38,7 @@ LL | |     }
 ...
 LL |       define_include!();
    |       ------------------ in this macro invocation
-   = help: use `self::include` to refer to this macro unambiguously
+   = help: use `crate::include` to refer to this macro unambiguously
 
 error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
   --> $DIR/local-modularized-tricky-fail-1.rs:45:5
@@ -57,13 +57,13 @@ LL | |     }
 ...
 LL |       define_panic!();
    |       ---------------- in this macro invocation
-   = help: use `self::panic` to refer to this macro unambiguously
+   = help: use `crate::panic` to refer to this macro unambiguously
 
 error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
-  --> <::std::macros::panic macros>:1:13
+  --> $DIR/local-modularized-tricky-fail-1.rs:45:5
    |
-LL | (  ) => ( { panic ! ( "explicit panic" ) } ) ; ( $ msg : expr ) => (
-   |             ^^^^^ ambiguous name
+LL |     panic!(); //~ ERROR `panic` is ambiguous
+   |     ^^^^^^^^^ ambiguous name
    |
    = note: `panic` could refer to a macro from prelude
 note: `panic` could also refer to the macro defined here
@@ -76,7 +76,8 @@ LL | |     }
 ...
 LL |       define_panic!();
    |       ---------------- in this macro invocation
-   = help: use `self::panic` to refer to this macro unambiguously
+   = help: use `crate::panic` to refer to this macro unambiguously
+   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
 error: aborting due to 4 previous errors
 
index 8e8742f849bf07516564da3b00e5999f7b4dcda7..3f481b0cfb0df95e92e3e9099c51acf6f0aca186 100644 (file)
@@ -34,7 +34,7 @@ LL | / pub mod baz {
 LL | |     pub use two_macros::m;
 LL | | }
    | |_^
-   = help: use `self::baz` to refer to this module unambiguously
+   = help: use `crate::baz` to refer to this module unambiguously
 
 error: aborting due to 2 previous errors
 
index 2135d63c80ec28e4b96e4bde5f07fd1f503cc0eb..9d61799713b043c99ffbc68b50b5fd0cd63c1f0a 100644 (file)
@@ -3,6 +3,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |             m!(); //~ ERROR `m` is ambiguous
    |             ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -26,6 +29,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |         macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
    |                                          ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -49,6 +55,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |         m!(); //~ ERROR `m` is ambiguous
    |         ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -72,6 +81,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |         m!(); //~ ERROR `m` is ambiguous
    |         ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -95,6 +107,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |             m!(); //~ ERROR `m` is ambiguous
    |             ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -118,6 +133,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |         macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
    |                                          ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -141,6 +159,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |         m!(); //~ ERROR `m` is ambiguous
    |         ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
@@ -164,6 +185,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |         macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
    |                                          ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-legacy.rs:88:9
index 2449e8512d3cd1ed73f82238a75309e9a487f7a0..398a7660d3093b2fd912d064e5ab4be1620159fa 100644 (file)
@@ -3,6 +3,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |                 m!(); //~ ERROR `m` is ambiguous
    |                 ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-modern.rs:91:9
@@ -26,6 +29,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |             macro gen_invoc() { m!() } //~ ERROR `m` is ambiguous
    |                                 ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-modern.rs:91:9
@@ -49,6 +55,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |             m!(); //~ ERROR `m` is ambiguous
    |             ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-modern.rs:91:9
@@ -72,6 +81,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |             m!(); //~ ERROR `m` is ambiguous
    |             ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-modern.rs:91:9
@@ -95,6 +107,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |                 m!(); //~ ERROR `m` is ambiguous
    |                 ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-modern.rs:91:9
@@ -118,6 +133,9 @@ error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name
    |
 LL |             macro gen_invoc() { m!() } //~ ERROR `m` is ambiguous
    |                                 ^ ambiguous name
+...
+LL | include!();
+   | ----------- in this macro invocation
    |
 note: `m` could refer to the macro defined here
   --> $DIR/restricted-shadowing-modern.rs:91:9
index ac8d3b9d0cbe4d0dc347f35a2c901d89e375f29b..a9e6da8f211b31d4ea5b6d080d5ea6e6132d5e4e 100644 (file)
@@ -16,7 +16,7 @@ LL | |         }
 ...
 LL |   m!();
    |   ----- in this macro invocation
-   = help: use `self::std` to refer to this module unambiguously
+   = help: use `crate::std` to refer to this module unambiguously
 
 error: aborting due to previous error
 
index beeb74654e5b5bc7194dc9c2fba8a68703f7834c..b1feb82fba90d83f0f8f2be97db14455b69e2f7b 100644 (file)
@@ -13,7 +13,7 @@ LL | / mod std {
 LL | |     pub struct io;
 LL | | }
    | |_^
-   = help: use `self::std` to refer to this module unambiguously
+   = help: use `crate::std` to refer to this module unambiguously
 
 error: aborting due to previous error
 
index aa46947f93f4be0c9f89c9da00a6970a3dce6e0c..0088296b1a4717217c8bfcca034ae2b978d62a30 100644 (file)
@@ -16,7 +16,7 @@ LL | / mod sub {
 LL | |     pub fn bar() {}
 LL | | }
    | |_^
-   = help: use `self::sub` to refer to this module unambiguously
+   = help: use `crate::sub` to refer to this module unambiguously
 
 error: aborting due to previous error
 
index 010b9efad393b43a3a90803fbc7b2e99b04a316a..213f723385b1c082455ca512d0371c978ea65a78 100644 (file)
@@ -14,7 +14,7 @@ note: `Foo` could also refer to the enum defined here
    |
 LL | enum Foo {}
    | ^^^^^^^^^^^
-   = help: use `self::Foo` to refer to this enum unambiguously
+   = help: use `crate::Foo` to refer to this enum unambiguously
 
 error[E0659]: `std` is ambiguous (name vs any other name during import resolution)
   --> $DIR/block-scoped-shadow.rs:26:9
@@ -32,7 +32,7 @@ note: `std` could also refer to the struct defined here
    |
 LL | struct std;
    | ^^^^^^^^^^^
-   = help: use `self::std` to refer to this struct unambiguously
+   = help: use `crate::std` to refer to this struct unambiguously
 
 error[E0659]: `std` is ambiguous (name vs any other name during import resolution)
   --> $DIR/block-scoped-shadow.rs:26:9
@@ -50,7 +50,7 @@ note: `std` could also refer to the unit struct defined here
    |
 LL | struct std;
    | ^^^^^^^^^^^
-   = help: use `self::std` to refer to this unit struct unambiguously
+   = help: use `crate::std` to refer to this unit struct unambiguously
 
 error: aborting due to 3 previous errors