resolve: Suggest crate::
for resolving ambiguities when appropriate
More precise spans for ambiguities from macros
This commit is contained in:
parent
d1862b4196
commit
6f13708299
16 changed files with 110 additions and 49 deletions
|
@ -1292,6 +1292,7 @@ impl AmbiguityKind {
|
|||
/// Miscellaneous bits of metadata for better ambiguity error reporting.
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
enum AmbiguityErrorMisc {
|
||||
SuggestCrate,
|
||||
SuggestSelf,
|
||||
FromPrelude,
|
||||
None,
|
||||
|
@ -4870,12 +4871,21 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
|
|||
`{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()))
|
||||
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()))
|
||||
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() {
|
||||
|
|
|
@ -42,7 +42,7 @@ use syntax_pos::{Span, DUMMY_SP};
|
|||
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 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
|
|||
|
||||
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 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
|
|||
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 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
|
|||
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 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
|
|||
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 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
|
|||
};
|
||||
self.ambiguity_errors.push(AmbiguityError {
|
||||
kind,
|
||||
ident,
|
||||
ident: orig_ident,
|
||||
b1: innermost_binding,
|
||||
b2: binding,
|
||||
misc1: misc(innermost_flags),
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ mod inner2 {
|
|||
|
||||
fn main() {
|
||||
panic!(); //~ ERROR `panic` is ambiguous
|
||||
//~| ERROR `panic` is ambiguous
|
||||
}
|
||||
|
||||
mod inner3 {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue