resolve: Tweak some articles in ambiguity diagnostics
This commit is contained in:
parent
cfe81559ee
commit
cfd762954b
@ -406,13 +406,13 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver,
|
||||
err
|
||||
}
|
||||
ResolutionError::BindingShadowsSomethingUnacceptable(what_binding, name, binding) => {
|
||||
let (shadows_what, article) = (binding.descr(), binding.article());
|
||||
let shadows_what = binding.descr();
|
||||
let mut err = struct_span_err!(resolver.session, span, E0530, "{}s cannot shadow {}s",
|
||||
what_binding, shadows_what);
|
||||
err.span_label(span, format!("cannot be named the same as {} {}",
|
||||
article, shadows_what));
|
||||
binding.article(), shadows_what));
|
||||
let participle = if binding.is_import() { "imported" } else { "defined" };
|
||||
let msg = format!("{} {} `{}` is {} here", article, shadows_what, name, participle);
|
||||
let msg = format!("the {} `{}` is {} here", shadows_what, name, participle);
|
||||
err.span_label(binding.span, msg);
|
||||
err
|
||||
}
|
||||
@ -4788,11 +4788,11 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
|
||||
`{ident}` to disambiguate", ident = ident))
|
||||
}
|
||||
if b.is_extern_crate() && self.session.rust_2018() {
|
||||
help_msgs.push(format!("use `::{ident}` to refer to the {thing} unambiguously",
|
||||
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 the {thing} unambiguously",
|
||||
help_msgs.push(format!("use `self::{ident}` to refer to this {thing} unambiguously",
|
||||
ident = ident, thing = b.descr()))
|
||||
}
|
||||
|
||||
|
@ -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 the attribute macro unambiguously
|
||||
= help: use `self::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 the attribute macro unambiguously
|
||||
= help: use `self::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 the attribute macro unambiguously
|
||||
= help: use `self::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 the attribute macro unambiguously
|
||||
= help: use `self::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 the attribute macro unambiguously
|
||||
= help: use `self::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 the attribute macro unambiguously
|
||||
= help: use `self::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 the attribute macro unambiguously
|
||||
= help: use `self::my_attr` to refer to this attribute macro unambiguously
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow tuple structs
|
||||
--> $DIR/empty-struct-tuple-pat.rs:32:9
|
||||
|
|
||||
LL | struct Empty2();
|
||||
| ---------------- a tuple struct `Empty2` is defined here
|
||||
| ---------------- the tuple struct `Empty2` is defined here
|
||||
...
|
||||
LL | Empty2 => () //~ ERROR match bindings cannot shadow tuple structs
|
||||
| ^^^^^^ cannot be named the same as a tuple struct
|
||||
@ -11,7 +11,7 @@ error[E0530]: match bindings cannot shadow tuple structs
|
||||
--> $DIR/empty-struct-tuple-pat.rs:35:9
|
||||
|
|
||||
LL | use empty_struct::*;
|
||||
| --------------- a tuple struct `XEmpty6` is imported here
|
||||
| --------------- the tuple struct `XEmpty6` is imported here
|
||||
...
|
||||
LL | XEmpty6 => () //~ ERROR match bindings cannot shadow tuple structs
|
||||
| ^^^^^^^ cannot be named the same as a tuple struct
|
||||
|
@ -2,7 +2,7 @@ error[E0530]: let bindings cannot shadow tuple structs
|
||||
--> $DIR/enum-in-scope.rs:14:9
|
||||
|
|
||||
LL | struct hello(isize);
|
||||
| -------------------- a tuple struct `hello` is defined here
|
||||
| -------------------- the tuple struct `hello` is defined here
|
||||
...
|
||||
LL | let hello = 0; //~ERROR let bindings cannot shadow tuple structs
|
||||
| ^^^^^ cannot be named the same as a tuple struct
|
||||
|
@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow statics
|
||||
--> $DIR/E0530.rs:16:9
|
||||
|
|
||||
LL | static TEST: i32 = 0;
|
||||
| --------------------- a static `TEST` is defined here
|
||||
| --------------------- the static `TEST` is defined here
|
||||
...
|
||||
LL | TEST => {} //~ ERROR E0530
|
||||
| ^^^^ cannot be named the same as a static
|
||||
|
@ -11,7 +11,7 @@ note: `env` could also refer to the macro imported here
|
||||
LL | use m::*;
|
||||
| ^^^^
|
||||
= help: consider adding an explicit import of `env` to disambiguate
|
||||
= help: or use `self::env` to refer to the macro unambiguously
|
||||
= help: or use `self::env` to refer to this macro unambiguously
|
||||
|
||||
error[E0659]: `env` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
|
||||
--> $DIR/glob-shadowing.rs:29:21
|
||||
@ -44,7 +44,7 @@ note: `fenv` could also refer to the macro defined here
|
||||
|
|
||||
LL | pub macro fenv($e: expr) { $e }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= help: use `self::fenv` to refer to the macro unambiguously
|
||||
= help: use `self::fenv` to refer to this macro unambiguously
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
@ -20,7 +20,7 @@ note: `mac` could also refer to the unresolved item imported here
|
||||
|
|
||||
LL | use nonexistent_module::mac; //~ ERROR unresolved import `nonexistent_module`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= help: use `self::mac` to refer to the unresolved item unambiguously
|
||||
= help: use `self::mac` to refer to this unresolved item unambiguously
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -38,7 +38,7 @@ LL | | }
|
||||
...
|
||||
LL | define_include!();
|
||||
| ------------------ in this macro invocation
|
||||
= help: use `self::include` to refer to the macro unambiguously
|
||||
= help: use `self::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,7 +57,7 @@ LL | | }
|
||||
...
|
||||
LL | define_panic!();
|
||||
| ---------------- in this macro invocation
|
||||
= help: use `self::panic` to refer to the macro unambiguously
|
||||
= help: use `self::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
|
||||
@ -76,7 +76,7 @@ LL | | }
|
||||
...
|
||||
LL | define_panic!();
|
||||
| ---------------- in this macro invocation
|
||||
= help: use `self::panic` to refer to the macro unambiguously
|
||||
= help: use `self::panic` to refer to this macro unambiguously
|
||||
|
||||
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 the module unambiguously
|
||||
= help: use `self::baz` to refer to this module unambiguously
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -32,7 +32,7 @@ note: `m` could also refer to the macro imported here
|
||||
|
|
||||
LL | use two_macros::m;
|
||||
| ^^^^^^^^^^^^^
|
||||
= help: use `self::m` to refer to the macro unambiguously
|
||||
= help: use `self::m` to refer to this macro unambiguously
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -11,7 +11,7 @@ note: `panic` could also refer to the macro imported here
|
||||
LL | use foo::*;
|
||||
| ^^^^^^
|
||||
= help: consider adding an explicit import of `panic` to disambiguate
|
||||
= help: or use `self::panic` to refer to the macro unambiguously
|
||||
= help: or use `self::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)
|
||||
--> $DIR/shadow_builtin_macros.rs:30:14
|
||||
@ -25,7 +25,7 @@ note: `panic` could also refer to the macro imported here
|
||||
|
|
||||
LL | ::two_macros::m!(use foo::panic;);
|
||||
| ^^^^^^^^^^
|
||||
= help: use `self::panic` to refer to the macro unambiguously
|
||||
= help: use `self::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)
|
||||
--> $DIR/shadow_builtin_macros.rs:43:5
|
||||
@ -55,7 +55,7 @@ note: `n` could refer to the macro imported here
|
||||
LL | use bar::*;
|
||||
| ^^^^^^
|
||||
= help: consider adding an explicit import of `n` to disambiguate
|
||||
= help: or use `self::n` to refer to the macro unambiguously
|
||||
= help: or use `self::n` to refer to this macro unambiguously
|
||||
note: `n` could also refer to the macro imported here
|
||||
--> $DIR/shadow_builtin_macros.rs:46:13
|
||||
|
|
||||
|
@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow statics
|
||||
--> $DIR/issue-16149.rs:17:9
|
||||
|
|
||||
LL | static externalValue: isize;
|
||||
| ---------------------------- a static `externalValue` is defined here
|
||||
| ---------------------------- the static `externalValue` is defined here
|
||||
...
|
||||
LL | externalValue => true,
|
||||
| ^^^^^^^^^^^^^ cannot be named the same as a static
|
||||
|
@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow statics
|
||||
--> $DIR/issue-17718-patterns.rs:17:9
|
||||
|
|
||||
LL | static A1: usize = 1;
|
||||
| --------------------- a static `A1` is defined here
|
||||
| --------------------- the static `A1` is defined here
|
||||
...
|
||||
LL | A1 => {} //~ ERROR: match bindings cannot shadow statics
|
||||
| ^^ cannot be named the same as a static
|
||||
@ -11,7 +11,7 @@ error[E0530]: match bindings cannot shadow statics
|
||||
--> $DIR/issue-17718-patterns.rs:18:9
|
||||
|
|
||||
LL | static mut A2: usize = 1;
|
||||
| ------------------------- a static `A2` is defined here
|
||||
| ------------------------- the static `A2` is defined here
|
||||
...
|
||||
LL | A2 => {} //~ ERROR: match bindings cannot shadow statics
|
||||
| ^^ cannot be named the same as a static
|
||||
|
@ -2,7 +2,7 @@ error[E0530]: function parameters cannot shadow statics
|
||||
--> $DIR/issue-23716.rs:13:8
|
||||
|
|
||||
LL | static foo: i32 = 0;
|
||||
| -------------------- a static `foo` is defined here
|
||||
| -------------------- the static `foo` is defined here
|
||||
LL |
|
||||
LL | fn bar(foo: i32) {}
|
||||
| ^^^ cannot be named the same as a static
|
||||
@ -11,7 +11,7 @@ error[E0530]: function parameters cannot shadow statics
|
||||
--> $DIR/issue-23716.rs:23:13
|
||||
|
|
||||
LL | use self::submod::answer;
|
||||
| -------------------- a static `answer` is imported here
|
||||
| -------------------- the static `answer` is imported here
|
||||
LL |
|
||||
LL | fn question(answer: i32) {}
|
||||
| ^^^^^^ cannot be named the same as a static
|
||||
|
@ -8,7 +8,7 @@ error[E0530]: match bindings cannot shadow constants
|
||||
--> $DIR/issue-27033.rs:17:9
|
||||
|
|
||||
LL | const C: u8 = 1;
|
||||
| ---------------- a constant `C` is defined here
|
||||
| ---------------- the constant `C` is defined here
|
||||
LL | match 1 {
|
||||
LL | C @ 2 => { //~ ERROR match bindings cannot shadow constant
|
||||
| ^ cannot be named the same as a constant
|
||||
|
@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow constants
|
||||
--> $DIR/issue-34047.rs:15:13
|
||||
|
|
||||
LL | const C: u8 = 0;
|
||||
| ---------------- a constant `C` is defined here
|
||||
| ---------------- the constant `C` is defined here
|
||||
...
|
||||
LL | mut C => {} //~ ERROR match bindings cannot shadow constants
|
||||
| ^ cannot be named the same as a constant
|
||||
|
@ -11,7 +11,7 @@ note: `std` could also refer to the module imported here
|
||||
LL | use m2::*; // glob-import user-defined `std`
|
||||
| ^^^^^
|
||||
= help: consider adding an explicit import of `std` to disambiguate
|
||||
= help: or use `self::std` to refer to the module unambiguously
|
||||
= help: or use `self::std` to refer to this module unambiguously
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -2,7 +2,7 @@ error[E0530]: let bindings cannot shadow tuple structs
|
||||
--> $DIR/pat-shadow-in-nested-binding.rs:14:10
|
||||
|
|
||||
LL | struct foo(usize);
|
||||
| ------------------ a tuple struct `foo` is defined here
|
||||
| ------------------ the tuple struct `foo` is defined here
|
||||
...
|
||||
LL | let (foo, _) = (2, 3); //~ ERROR let bindings cannot shadow tuple structs
|
||||
| ^^^ cannot be named the same as a tuple struct
|
||||
|
@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow tuple structs
|
||||
--> $DIR/pattern-binding-disambiguation.rs:34:9
|
||||
|
|
||||
LL | struct TupleStruct();
|
||||
| --------------------- a tuple struct `TupleStruct` is defined here
|
||||
| --------------------- the tuple struct `TupleStruct` is defined here
|
||||
...
|
||||
LL | TupleStruct => {} //~ ERROR match bindings cannot shadow tuple structs
|
||||
| ^^^^^^^^^^^ cannot be named the same as a tuple struct
|
||||
@ -11,7 +11,7 @@ error[E0530]: match bindings cannot shadow tuple variants
|
||||
--> $DIR/pattern-binding-disambiguation.rs:43:9
|
||||
|
|
||||
LL | use E::*;
|
||||
| ---- a tuple variant `TupleVariant` is imported here
|
||||
| ---- the tuple variant `TupleVariant` is imported here
|
||||
...
|
||||
LL | TupleVariant => {} //~ ERROR match bindings cannot shadow tuple variants
|
||||
| ^^^^^^^^^^^^ cannot be named the same as a tuple variant
|
||||
@ -20,7 +20,7 @@ error[E0530]: match bindings cannot shadow struct variants
|
||||
--> $DIR/pattern-binding-disambiguation.rs:46:9
|
||||
|
|
||||
LL | use E::*;
|
||||
| ---- a struct variant `BracedVariant` is imported here
|
||||
| ---- the struct variant `BracedVariant` is imported here
|
||||
...
|
||||
LL | BracedVariant => {} //~ ERROR match bindings cannot shadow struct variants
|
||||
| ^^^^^^^^^^^^^ cannot be named the same as a struct variant
|
||||
@ -29,7 +29,7 @@ error[E0530]: match bindings cannot shadow statics
|
||||
--> $DIR/pattern-binding-disambiguation.rs:52:9
|
||||
|
|
||||
LL | static STATIC: () = ();
|
||||
| ----------------------- a static `STATIC` is defined here
|
||||
| ----------------------- the static `STATIC` is defined here
|
||||
...
|
||||
LL | STATIC => {} //~ ERROR match bindings cannot shadow statics
|
||||
| ^^^^^^ cannot be named the same as a static
|
||||
@ -38,7 +38,7 @@ error[E0530]: let bindings cannot shadow tuple structs
|
||||
--> $DIR/pattern-binding-disambiguation.rs:59:9
|
||||
|
|
||||
LL | struct TupleStruct();
|
||||
| --------------------- a tuple struct `TupleStruct` is defined here
|
||||
| --------------------- the tuple struct `TupleStruct` is defined here
|
||||
...
|
||||
LL | let TupleStruct = doesnt_matter; //~ ERROR let bindings cannot shadow tuple structs
|
||||
| ^^^^^^^^^^^ cannot be named the same as a tuple struct
|
||||
@ -47,7 +47,7 @@ error[E0530]: let bindings cannot shadow tuple variants
|
||||
--> $DIR/pattern-binding-disambiguation.rs:62:9
|
||||
|
|
||||
LL | use E::*;
|
||||
| ---- a tuple variant `TupleVariant` is imported here
|
||||
| ---- the tuple variant `TupleVariant` is imported here
|
||||
...
|
||||
LL | let TupleVariant = doesnt_matter; //~ ERROR let bindings cannot shadow tuple variants
|
||||
| ^^^^^^^^^^^^ cannot be named the same as a tuple variant
|
||||
@ -56,7 +56,7 @@ error[E0530]: let bindings cannot shadow struct variants
|
||||
--> $DIR/pattern-binding-disambiguation.rs:63:9
|
||||
|
|
||||
LL | use E::*;
|
||||
| ---- a struct variant `BracedVariant` is imported here
|
||||
| ---- the struct variant `BracedVariant` is imported here
|
||||
...
|
||||
LL | let BracedVariant = doesnt_matter; //~ ERROR let bindings cannot shadow struct variants
|
||||
| ^^^^^^^^^^^^^ cannot be named the same as a struct variant
|
||||
@ -65,7 +65,7 @@ error[E0530]: let bindings cannot shadow statics
|
||||
--> $DIR/pattern-binding-disambiguation.rs:65:9
|
||||
|
|
||||
LL | static STATIC: () = ();
|
||||
| ----------------------- a static `STATIC` is defined here
|
||||
| ----------------------- the static `STATIC` is defined here
|
||||
...
|
||||
LL | let STATIC = doesnt_matter; //~ ERROR let bindings cannot shadow statics
|
||||
| ^^^^^^ cannot be named the same as a static
|
||||
|
@ -5,7 +5,7 @@ LL | pub use std::io;
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
= note: `std` could refer to a built-in extern crate
|
||||
= help: use `::std` to refer to the extern crate unambiguously
|
||||
= help: use `::std` to refer to this extern crate unambiguously
|
||||
note: `std` could also refer to the module defined here
|
||||
--> $DIR/ambiguity-macros-nested.rs:21:13
|
||||
|
|
||||
@ -16,7 +16,7 @@ LL | | }
|
||||
...
|
||||
LL | m!();
|
||||
| ----- in this macro invocation
|
||||
= help: use `self::std` to refer to the module unambiguously
|
||||
= help: use `self::std` to refer to this module unambiguously
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | use std::io;
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
= note: `std` could refer to a built-in extern crate
|
||||
= help: use `::std` to refer to the extern crate unambiguously
|
||||
= help: use `::std` to refer to this extern crate unambiguously
|
||||
note: `std` could also refer to the module defined here
|
||||
--> $DIR/ambiguity-macros.rs:20:9
|
||||
|
|
||||
@ -16,7 +16,7 @@ LL | | }
|
||||
...
|
||||
LL | m!();
|
||||
| ----- in this macro invocation
|
||||
= help: use `self::std` to refer to the module unambiguously
|
||||
= help: use `self::std` to refer to this module unambiguously
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | pub use std::io;
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
= note: `std` could refer to a built-in extern crate
|
||||
= help: use `::std` to refer to the extern crate unambiguously
|
||||
= help: use `::std` to refer to this extern crate unambiguously
|
||||
note: `std` could also refer to the module defined here
|
||||
--> $DIR/ambiguity-nested.rs:19:5
|
||||
|
|
||||
@ -13,7 +13,7 @@ LL | / mod std {
|
||||
LL | | pub struct io;
|
||||
LL | | }
|
||||
| |_____^
|
||||
= help: use `self::std` to refer to the module unambiguously
|
||||
= help: use `self::std` to refer to this module unambiguously
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | use std::io;
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
= note: `std` could refer to a built-in extern crate
|
||||
= help: use `::std` to refer to the extern crate unambiguously
|
||||
= help: use `::std` to refer to this extern crate unambiguously
|
||||
note: `std` could also refer to the module defined here
|
||||
--> $DIR/ambiguity.rs:16:1
|
||||
|
|
||||
@ -13,7 +13,7 @@ LL | / mod std {
|
||||
LL | | pub struct io;
|
||||
LL | | }
|
||||
| |_^
|
||||
= help: use `self::std` to refer to the module unambiguously
|
||||
= help: use `self::std` to refer to this module unambiguously
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -14,7 +14,7 @@ note: `std` could also refer to the struct defined here
|
||||
|
|
||||
LL | struct std;
|
||||
| ^^^^^^^^^^^
|
||||
= help: use `self::std` to refer to the struct unambiguously
|
||||
= help: use `self::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:18:9
|
||||
@ -32,7 +32,7 @@ note: `std` could also refer to the unit struct defined here
|
||||
|
|
||||
LL | struct std;
|
||||
| ^^^^^^^^^^^
|
||||
= help: use `self::std` to refer to the unit struct unambiguously
|
||||
= help: use `self::std` to refer to this unit struct unambiguously
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | pub use std::io;
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
= note: `std` could refer to a built-in extern crate
|
||||
= help: use `::std` to refer to the extern crate unambiguously
|
||||
= help: use `::std` to refer to this extern crate unambiguously
|
||||
note: `std` could also refer to the module defined here
|
||||
--> $DIR/ambiguity-macros-nested.rs:23:13
|
||||
|
|
||||
@ -16,7 +16,7 @@ LL | | }
|
||||
...
|
||||
LL | m!();
|
||||
| ----- in this macro invocation
|
||||
= help: use `self::std` to refer to the module unambiguously
|
||||
= help: use `self::std` to refer to this module unambiguously
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | use std::io;
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
= note: `std` could refer to a built-in extern crate
|
||||
= help: use `::std` to refer to the extern crate unambiguously
|
||||
= help: use `::std` to refer to this extern crate unambiguously
|
||||
note: `std` could also refer to the module defined here
|
||||
--> $DIR/ambiguity-macros.rs:22:9
|
||||
|
|
||||
@ -16,7 +16,7 @@ LL | | }
|
||||
...
|
||||
LL | m!();
|
||||
| ----- in this macro invocation
|
||||
= help: use `self::std` to refer to the module unambiguously
|
||||
= help: use `self::std` to refer to this module unambiguously
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | pub use std::io;
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
= note: `std` could refer to a built-in extern crate
|
||||
= help: use `::std` to refer to the extern crate unambiguously
|
||||
= help: use `::std` to refer to this extern crate unambiguously
|
||||
note: `std` could also refer to the module defined here
|
||||
--> $DIR/ambiguity-nested.rs:21:5
|
||||
|
|
||||
@ -13,7 +13,7 @@ LL | / mod std {
|
||||
LL | | pub struct io;
|
||||
LL | | }
|
||||
| |_____^
|
||||
= help: use `self::std` to refer to the module unambiguously
|
||||
= help: use `self::std` to refer to this module unambiguously
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | use std::io;
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
= note: `std` could refer to a built-in extern crate
|
||||
= help: use `::std` to refer to the extern crate unambiguously
|
||||
= help: use `::std` to refer to this extern crate unambiguously
|
||||
note: `std` could also refer to the module defined here
|
||||
--> $DIR/ambiguity.rs:18:1
|
||||
|
|
||||
@ -13,7 +13,7 @@ LL | / mod std {
|
||||
LL | | pub struct io;
|
||||
LL | | }
|
||||
| |_^
|
||||
= help: use `self::std` to refer to the module unambiguously
|
||||
= help: use `self::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 the module unambiguously
|
||||
= help: use `self::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 the enum unambiguously
|
||||
= help: use `self::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:28: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 the struct unambiguously
|
||||
= help: use `self::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:28: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 the unit struct unambiguously
|
||||
= help: use `self::std` to refer to this unit struct unambiguously
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow statics
|
||||
--> $DIR/static-mut-not-pat.rs:23:9
|
||||
|
|
||||
LL | static mut a: isize = 3;
|
||||
| ------------------------ a static `a` is defined here
|
||||
| ------------------------ the static `a` is defined here
|
||||
...
|
||||
LL | a => {} //~ ERROR match bindings cannot shadow statics
|
||||
| ^ cannot be named the same as a static
|
||||
@ -11,7 +11,7 @@ error[E0530]: match bindings cannot shadow statics
|
||||
--> $DIR/static-mut-not-pat.rs:46:9
|
||||
|
|
||||
LL | static mut STATIC_MUT_FOO: Foo = Foo { bar: Some(Direction::West), baz: NEW_FALSE };
|
||||
| ------------------------------------------------------------------------------------ a static `STATIC_MUT_FOO` is defined here
|
||||
| ------------------------------------------------------------------------------------ the static `STATIC_MUT_FOO` is defined here
|
||||
...
|
||||
LL | STATIC_MUT_FOO => (),
|
||||
| ^^^^^^^^^^^^^^ cannot be named the same as a static
|
||||
|
Loading…
x
Reference in New Issue
Block a user