Auto merge of #56042 - petrochenkov:nuni, r=petrochenkov
[nightly] resolve: Implement uniform paths 2.0 Forward-port of https://github.com/rust-lang/rust/pull/55884 to nightly. r? @ghost
This commit is contained in:
commit
7e82eda000
186 changed files with 2227 additions and 1561 deletions
|
|
@ -1,16 +1,16 @@
|
|||
error[E0433]: failed to resolve. crate root in paths can only be used in start position
|
||||
error[E0433]: failed to resolve: crate root in paths can only be used in start position
|
||||
--> $DIR/absolute-paths-in-nested-use-groups.rs:16:5
|
||||
|
|
||||
LL | ::bar, //~ ERROR crate root in paths can only be used in start position
|
||||
| ^ crate root in paths can only be used in start position
|
||||
|
||||
error[E0433]: failed to resolve. `super` in paths can only be used in start position
|
||||
error[E0433]: failed to resolve: `super` in paths can only be used in start position
|
||||
--> $DIR/absolute-paths-in-nested-use-groups.rs:17:5
|
||||
|
|
||||
LL | super::bar, //~ ERROR `super` in paths can only be used in start position
|
||||
| ^^^^^ `super` in paths can only be used in start position
|
||||
|
||||
error[E0433]: failed to resolve. `self` in paths can only be used in start position
|
||||
error[E0433]: failed to resolve: `self` in paths can only be used in start position
|
||||
--> $DIR/absolute-paths-in-nested-use-groups.rs:18:5
|
||||
|
|
||||
LL | self::bar, //~ ERROR `self` in paths can only be used in start position
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
fn main() {
|
||||
let foo = thing::len(Vec::new());
|
||||
//~^ ERROR failed to resolve. Use of undeclared type or module `thing`
|
||||
//~^ ERROR failed to resolve: use of undeclared type or module `thing`
|
||||
|
||||
let foo = foo::bar::baz();
|
||||
//~^ ERROR failed to resolve. Use of undeclared type or module `foo`
|
||||
//~^ ERROR failed to resolve: use of undeclared type or module `foo`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
error[E0433]: failed to resolve. Use of undeclared type or module `thing`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `thing`
|
||||
--> $DIR/bad-module.rs:12:15
|
||||
|
|
||||
LL | let foo = thing::len(Vec::new());
|
||||
| ^^^^^ Use of undeclared type or module `thing`
|
||||
| ^^^^^ use of undeclared type or module `thing`
|
||||
|
||||
error[E0433]: failed to resolve. Use of undeclared type or module `foo`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `foo`
|
||||
--> $DIR/bad-module.rs:15:15
|
||||
|
|
||||
LL | let foo = foo::bar::baz();
|
||||
| ^^^ Use of undeclared type or module `foo`
|
||||
| ^^^ use of undeclared type or module `foo`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
|
||||
mod existent {}
|
||||
|
||||
#[existent::nonexistent] //~ ERROR failed to resolve. Could not find `nonexistent` in `existent`
|
||||
#[existent::nonexistent] //~ ERROR failed to resolve: could not find `nonexistent` in `existent`
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. Could not find `nonexistent` in `existent`
|
||||
error[E0433]: failed to resolve: could not find `nonexistent` in `existent`
|
||||
--> $DIR/custom-attribute-multisegment.rs:17:13
|
||||
|
|
||||
LL | #[existent::nonexistent] //~ ERROR failed to resolve. Could not find `nonexistent` in `existent`
|
||||
| ^^^^^^^^^^^ Could not find `nonexistent` in `existent`
|
||||
LL | #[existent::nonexistent] //~ ERROR failed to resolve: could not find `nonexistent` in `existent`
|
||||
| ^^^^^^^^^^^ could not find `nonexistent` in `existent`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. Use of undeclared type or module `HashMap`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `HashMap`
|
||||
--> $DIR/issue-31997-1.rs:30:19
|
||||
|
|
||||
LL | let mut map = HashMap::new();
|
||||
| ^^^^^^^ Use of undeclared type or module `HashMap`
|
||||
| ^^^^^^^ use of undeclared type or module `HashMap`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve. `$crate` in paths can only be used in start position
|
||||
error[E0433]: failed to resolve: `$crate` in paths can only be used in start position
|
||||
--> $DIR/dollar-crate-is-keyword-2.rs:16:16
|
||||
|
|
||||
LL | use a::$crate::b; //~ ERROR `$crate` in paths can only be used in start position
|
||||
|
|
@ -16,7 +16,7 @@ LL | use a::$crate; //~ ERROR unresolved import `a::$crate`
|
|||
LL | m!();
|
||||
| ----- in this macro invocation
|
||||
|
||||
error[E0433]: failed to resolve. `$crate` in paths can only be used in start position
|
||||
error[E0433]: failed to resolve: `$crate` in paths can only be used in start position
|
||||
--> $DIR/dollar-crate-is-keyword-2.rs:17:21
|
||||
|
|
||||
LL | type A = a::$crate; //~ ERROR `$crate` in paths can only be used in start position
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
type A0 = dyn;
|
||||
//~^ ERROR cannot find type `dyn` in this scope
|
||||
type A1 = dyn::dyn;
|
||||
//~^ ERROR Use of undeclared type or module `dyn`
|
||||
//~^ ERROR use of undeclared type or module `dyn`
|
||||
type A2 = dyn<dyn, dyn>;
|
||||
//~^ ERROR cannot find type `dyn` in this scope
|
||||
//~| ERROR cannot find type `dyn` in this scope
|
||||
|
|
@ -19,6 +19,6 @@ type A2 = dyn<dyn, dyn>;
|
|||
type A3 = dyn<<dyn as dyn>::dyn>;
|
||||
//~^ ERROR cannot find type `dyn` in this scope
|
||||
//~| ERROR cannot find type `dyn` in this scope
|
||||
//~| ERROR Use of undeclared type or module `dyn`
|
||||
//~| ERROR use of undeclared type or module `dyn`
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
error[E0433]: failed to resolve. Use of undeclared type or module `dyn`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `dyn`
|
||||
--> $DIR/dyn-trait-compatibility.rs:13:11
|
||||
|
|
||||
LL | type A1 = dyn::dyn;
|
||||
| ^^^ Use of undeclared type or module `dyn`
|
||||
| ^^^ use of undeclared type or module `dyn`
|
||||
|
||||
error[E0433]: failed to resolve. Use of undeclared type or module `dyn`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `dyn`
|
||||
--> $DIR/dyn-trait-compatibility.rs:19:23
|
||||
|
|
||||
LL | type A3 = dyn<<dyn as dyn>::dyn>;
|
||||
| ^^^ Use of undeclared type or module `dyn`
|
||||
| ^^^ use of undeclared type or module `dyn`
|
||||
|
||||
error[E0412]: cannot find type `dyn` in this scope
|
||||
--> $DIR/dyn-trait-compatibility.rs:11:11
|
||||
|
|
|
|||
|
|
@ -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[E0432]: unresolved import `something`
|
|||
--> $DIR/E0432.rs:11:5
|
||||
|
|
||||
LL | use something::Foo; //~ ERROR E0432
|
||||
| ^^^^^^^^^ Maybe a missing `extern crate something;`?
|
||||
| ^^^^^^^^^ maybe a missing `extern crate something;`?
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. Use of undeclared type or module `HashMap`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `HashMap`
|
||||
--> $DIR/E0433.rs:12:15
|
||||
|
|
||||
LL | let map = HashMap::new(); //~ ERROR E0433
|
||||
| ^^^^^^^ Use of undeclared type or module `HashMap`
|
||||
| ^^^^^^^ use of undeclared type or module `HashMap`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,20 +1,21 @@
|
|||
error[E0659]: `foo` is ambiguous
|
||||
error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module)
|
||||
--> $DIR/E0659.rs:25:15
|
||||
|
|
||||
LL | collider::foo(); //~ ERROR E0659
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `foo` could refer to the name imported here
|
||||
note: `foo` could refer to the function imported here
|
||||
--> $DIR/E0659.rs:20:13
|
||||
|
|
||||
LL | pub use moon::*;
|
||||
| ^^^^^^^
|
||||
note: `foo` could also refer to the name imported here
|
||||
= help: consider adding an explicit import of `foo` to disambiguate
|
||||
note: `foo` could also refer to the function imported here
|
||||
--> $DIR/E0659.rs:21:13
|
||||
|
|
||||
LL | pub use earth::*;
|
||||
| ^^^^^^^^
|
||||
= note: consider adding an explicit import of `foo` to disambiguate
|
||||
= help: consider adding an explicit import of `foo` to disambiguate
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
// want to change eventually.
|
||||
|
||||
mod foo {
|
||||
pub fn bar() { foo::baz(); } //~ ERROR failed to resolve. Use of undeclared type or module `foo`
|
||||
pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared type or module `foo`
|
||||
|
||||
fn baz() { }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. Use of undeclared type or module `foo`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `foo`
|
||||
--> $DIR/export-fully-qualified.rs:16:20
|
||||
|
|
||||
LL | pub fn bar() { foo::baz(); } //~ ERROR failed to resolve. Use of undeclared type or module `foo`
|
||||
| ^^^ Use of undeclared type or module `foo`
|
||||
LL | pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared type or module `foo`
|
||||
| ^^^ use of undeclared type or module `foo`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
mod foo {
|
||||
pub fn x() { bar::x(); } //~ ERROR failed to resolve. Use of undeclared type or module `bar`
|
||||
pub fn x() { bar::x(); } //~ ERROR failed to resolve: use of undeclared type or module `bar`
|
||||
}
|
||||
|
||||
mod bar {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. Use of undeclared type or module `bar`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `bar`
|
||||
--> $DIR/export2.rs:12:18
|
||||
|
|
||||
LL | pub fn x() { bar::x(); } //~ ERROR failed to resolve. Use of undeclared type or module `bar`
|
||||
| ^^^ Use of undeclared type or module `bar`
|
||||
LL | pub fn x() { bar::x(); } //~ ERROR failed to resolve: use of undeclared type or module `bar`
|
||||
| ^^^ use of undeclared type or module `bar`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
2
src/test/ui/extern/extern-macro.rs
vendored
2
src/test/ui/extern/extern-macro.rs
vendored
|
|
@ -12,5 +12,5 @@
|
|||
|
||||
fn main() {
|
||||
enum Foo {}
|
||||
let _ = Foo::bar!(); //~ ERROR fail to resolve non-ident macro path
|
||||
let _ = Foo::bar!(); //~ ERROR failed to resolve: partially resolved path in a macro
|
||||
}
|
||||
|
|
|
|||
7
src/test/ui/extern/extern-macro.stderr
vendored
7
src/test/ui/extern/extern-macro.stderr
vendored
|
|
@ -1,8 +1,9 @@
|
|||
error: fail to resolve non-ident macro path
|
||||
error[E0433]: failed to resolve: partially resolved path in a macro
|
||||
--> $DIR/extern-macro.rs:15:13
|
||||
|
|
||||
LL | let _ = Foo::bar!(); //~ ERROR fail to resolve non-ident macro path
|
||||
| ^^^^^^^^
|
||||
LL | let _ = Foo::bar!(); //~ ERROR failed to resolve: partially resolved path in a macro
|
||||
| ^^^^^^^^ partially resolved path in a macro
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0433`.
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ error[E0432]: unresolved import `core`
|
|||
--> $DIR/feature-gate-extern_absolute_paths.rs:11:5
|
||||
|
|
||||
LL | use core::default; //~ ERROR unresolved import `core`
|
||||
| ^^^^ Maybe a missing `extern crate core;`?
|
||||
| ^^^^ maybe a missing `extern crate core;`?
|
||||
|
||||
error[E0433]: failed to resolve. Maybe a missing `extern crate core;`?
|
||||
error[E0433]: failed to resolve: maybe a missing `extern crate core;`?
|
||||
--> $DIR/feature-gate-extern_absolute_paths.rs:14:19
|
||||
|
|
||||
LL | let _: u8 = ::core::default::Default(); //~ ERROR failed to resolve
|
||||
| ^^^^ Maybe a missing `extern crate core;`?
|
||||
| ^^^^ maybe a missing `extern crate core;`?
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// edition:2018
|
||||
|
||||
#![feature(alloc)]
|
||||
#![feature(alloc, underscore_imports)]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ mod absolute {
|
|||
}
|
||||
|
||||
mod import_in_scope {
|
||||
use alloc;
|
||||
use alloc as _;
|
||||
//~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
|
||||
use alloc::boxed;
|
||||
//~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #55599)
|
||||
--> $DIR/feature-gate-extern_crate_item_prelude.rs:26:9
|
||||
|
|
||||
LL | use alloc;
|
||||
LL | use alloc as _;
|
||||
| ^^^^^
|
||||
|
|
||||
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable
|
||||
|
|
|
|||
|
|
@ -8,15 +8,22 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// edition:2018
|
||||
|
||||
pub mod foo {
|
||||
pub use bar::Bar;
|
||||
//~^ ERROR unresolved import `bar`
|
||||
pub use bar::Bar; //~ ERROR imports can only refer to extern crate names
|
||||
|
||||
pub mod bar {
|
||||
pub struct Bar;
|
||||
}
|
||||
}
|
||||
|
||||
use inline; //~ ERROR imports can only refer to extern crate names
|
||||
|
||||
use Vec; //~ ERROR imports can only refer to extern crate names
|
||||
|
||||
use vec; //~ ERROR imports can only refer to extern crate names
|
||||
|
||||
fn main() {
|
||||
let _ = foo::Bar;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,62 @@
|
|||
error[E0432]: unresolved import `bar`
|
||||
--> $DIR/feature-gate-uniform-paths.rs:12:13
|
||||
error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
|
||||
--> $DIR/feature-gate-uniform-paths.rs:14:13
|
||||
|
|
||||
LL | pub use bar::Bar;
|
||||
| ^^^ Did you mean `self::bar`?
|
||||
LL | pub use bar::Bar; //~ ERROR imports can only refer to extern crate names
|
||||
| ^^^
|
||||
LL |
|
||||
LL | / pub mod bar {
|
||||
LL | | pub struct Bar;
|
||||
LL | | }
|
||||
| |_____- not an extern crate passed with `--extern`
|
||||
|
|
||||
= help: add #![feature(uniform_paths)] to the crate attributes to enable
|
||||
note: this import refers to the module defined here
|
||||
--> $DIR/feature-gate-uniform-paths.rs:16:5
|
||||
|
|
||||
LL | / pub mod bar {
|
||||
LL | | pub struct Bar;
|
||||
LL | | }
|
||||
| |_____^
|
||||
|
||||
error: aborting due to previous error
|
||||
error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
|
||||
--> $DIR/feature-gate-uniform-paths.rs:21:5
|
||||
|
|
||||
LL | use inline; //~ ERROR imports can only refer to extern crate names
|
||||
| ^^^^^^ not an extern crate passed with `--extern`
|
||||
|
|
||||
= help: add #![feature(uniform_paths)] to the crate attributes to enable
|
||||
note: this import refers to the built-in attribute imported here
|
||||
--> $DIR/feature-gate-uniform-paths.rs:21:5
|
||||
|
|
||||
LL | use inline; //~ ERROR imports can only refer to extern crate names
|
||||
| ^^^^^^
|
||||
|
||||
For more information about this error, try `rustc --explain E0432`.
|
||||
error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
|
||||
--> $DIR/feature-gate-uniform-paths.rs:23:5
|
||||
|
|
||||
LL | use Vec; //~ ERROR imports can only refer to extern crate names
|
||||
| ^^^ not an extern crate passed with `--extern`
|
||||
|
|
||||
= help: add #![feature(uniform_paths)] to the crate attributes to enable
|
||||
note: this import refers to the struct imported here
|
||||
--> $DIR/feature-gate-uniform-paths.rs:23:5
|
||||
|
|
||||
LL | use Vec; //~ ERROR imports can only refer to extern crate names
|
||||
| ^^^
|
||||
|
||||
error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
|
||||
--> $DIR/feature-gate-uniform-paths.rs:25:5
|
||||
|
|
||||
LL | use vec; //~ ERROR imports can only refer to extern crate names
|
||||
| ^^^ not an extern crate passed with `--extern`
|
||||
|
|
||||
= help: add #![feature(uniform_paths)] to the crate attributes to enable
|
||||
note: this import refers to the macro imported here
|
||||
--> $DIR/feature-gate-uniform-paths.rs:25:5
|
||||
|
|
||||
LL | use vec; //~ ERROR imports can only refer to extern crate names
|
||||
| ^^^
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
error[E0433]: failed to resolve. Use of undeclared type or module `Vec`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `Vec`
|
||||
--> $DIR/no_implicit_prelude.rs:21:9
|
||||
|
|
||||
LL | fn f() { ::bar::m!(); }
|
||||
| ------------ in this macro invocation
|
||||
...
|
||||
LL | Vec::new(); //~ ERROR failed to resolve
|
||||
| ^^^ Use of undeclared type or module `Vec`
|
||||
| ^^^ use of undeclared type or module `Vec`
|
||||
|
||||
error[E0599]: no method named `clone` found for type `()` in the current scope
|
||||
--> $DIR/no_implicit_prelude.rs:22:12
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
use baz::zed::bar; //~ ERROR unresolved import `baz::zed` [E0432]
|
||||
//~^ Could not find `zed` in `baz`
|
||||
//~^ could not find `zed` in `baz`
|
||||
|
||||
mod baz {}
|
||||
mod zed {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0432]: unresolved import `baz::zed`
|
|||
--> $DIR/import2.rs:11:10
|
||||
|
|
||||
LL | use baz::zed::bar; //~ ERROR unresolved import `baz::zed` [E0432]
|
||||
| ^^^ Could not find `zed` in `baz`
|
||||
| ^^^ could not find `zed` in `baz`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0432]: unresolved import `main`
|
|||
--> $DIR/import3.rs:12:5
|
||||
|
|
||||
LL | use main::bar;
|
||||
| ^^^^ Maybe a missing `extern crate main;`?
|
||||
| ^^^^ maybe a missing `extern crate main;`?
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
9
src/test/ui/imports/auxiliary/glob-conflict.rs
Normal file
9
src/test/ui/imports/auxiliary/glob-conflict.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
mod m1 {
|
||||
pub fn f() {}
|
||||
}
|
||||
mod m2 {
|
||||
pub fn f(_: u8) {}
|
||||
}
|
||||
|
||||
pub use m1::*;
|
||||
pub use m2::*;
|
||||
|
|
@ -12,77 +12,81 @@ help: you can use `as` to change the binding name of the import
|
|||
LL | use a::foo as other_foo; //~ ERROR the name `foo` is defined multiple times
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0659]: `foo` is ambiguous
|
||||
error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module)
|
||||
--> $DIR/duplicate.rs:56:15
|
||||
|
|
||||
LL | use self::foo::bar; //~ ERROR `foo` is ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `foo` could refer to the name imported here
|
||||
note: `foo` could refer to the module imported here
|
||||
--> $DIR/duplicate.rs:53:9
|
||||
|
|
||||
LL | use self::m1::*;
|
||||
| ^^^^^^^^^^^
|
||||
note: `foo` could also refer to the name imported here
|
||||
= help: consider adding an explicit import of `foo` to disambiguate
|
||||
note: `foo` could also refer to the module imported here
|
||||
--> $DIR/duplicate.rs:54:9
|
||||
|
|
||||
LL | use self::m2::*;
|
||||
| ^^^^^^^^^^^
|
||||
= note: consider adding an explicit import of `foo` to disambiguate
|
||||
= help: consider adding an explicit import of `foo` to disambiguate
|
||||
|
||||
error[E0659]: `foo` is ambiguous
|
||||
error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module)
|
||||
--> $DIR/duplicate.rs:45:8
|
||||
|
|
||||
LL | f::foo(); //~ ERROR `foo` is ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `foo` could refer to the name imported here
|
||||
note: `foo` could refer to the function imported here
|
||||
--> $DIR/duplicate.rs:34:13
|
||||
|
|
||||
LL | pub use a::*;
|
||||
| ^^^^
|
||||
note: `foo` could also refer to the name imported here
|
||||
= help: consider adding an explicit import of `foo` to disambiguate
|
||||
note: `foo` could also refer to the function imported here
|
||||
--> $DIR/duplicate.rs:35:13
|
||||
|
|
||||
LL | pub use b::*;
|
||||
| ^^^^
|
||||
= note: consider adding an explicit import of `foo` to disambiguate
|
||||
= help: consider adding an explicit import of `foo` to disambiguate
|
||||
|
||||
error[E0659]: `foo` is ambiguous
|
||||
error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module)
|
||||
--> $DIR/duplicate.rs:46:8
|
||||
|
|
||||
LL | g::foo(); //~ ERROR `foo` is ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `foo` could refer to the name imported here
|
||||
note: `foo` could refer to the function imported here
|
||||
--> $DIR/duplicate.rs:39:13
|
||||
|
|
||||
LL | pub use a::*;
|
||||
| ^^^^
|
||||
note: `foo` could also refer to the name imported here
|
||||
= help: consider adding an explicit import of `foo` to disambiguate
|
||||
note: `foo` could also refer to the unresolved item imported here
|
||||
--> $DIR/duplicate.rs:40:13
|
||||
|
|
||||
LL | pub use f::*;
|
||||
| ^^^^
|
||||
= note: consider adding an explicit import of `foo` to disambiguate
|
||||
= help: consider adding an explicit import of `foo` to disambiguate
|
||||
|
||||
error[E0659]: `foo` is ambiguous
|
||||
error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module)
|
||||
--> $DIR/duplicate.rs:59:9
|
||||
|
|
||||
LL | foo::bar(); //~ ERROR `foo` is ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `foo` could refer to the name imported here
|
||||
note: `foo` could refer to the module imported here
|
||||
--> $DIR/duplicate.rs:53:9
|
||||
|
|
||||
LL | use self::m1::*;
|
||||
| ^^^^^^^^^^^
|
||||
note: `foo` could also refer to the name imported here
|
||||
= help: consider adding an explicit import of `foo` to disambiguate
|
||||
note: `foo` could also refer to the module imported here
|
||||
--> $DIR/duplicate.rs:54:9
|
||||
|
|
||||
LL | use self::m2::*;
|
||||
| ^^^^^^^^^^^
|
||||
= note: consider adding an explicit import of `foo` to disambiguate
|
||||
= help: consider adding an explicit import of `foo` to disambiguate
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ mod n {
|
|||
|
||||
mod m {
|
||||
fn check() {
|
||||
two_macros::m!(); //~ ERROR failed to resolve. Use of undeclared type or module `two_macros`
|
||||
two_macros::m!(); //~ ERROR failed to resolve: use of undeclared type or module `two_macros`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ LL | extern crate std as non_existent;
|
|||
LL | define_std_as_non_existent!();
|
||||
| ------------------------------ in this macro invocation
|
||||
|
||||
error[E0433]: failed to resolve. Use of undeclared type or module `two_macros`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `two_macros`
|
||||
--> $DIR/extern-prelude-extern-crate-fail.rs:10:9
|
||||
|
|
||||
LL | two_macros::m!(); //~ ERROR failed to resolve. Use of undeclared type or module `two_macros`
|
||||
| ^^^^^^^^^^ Use of undeclared type or module `two_macros`
|
||||
LL | two_macros::m!(); //~ ERROR failed to resolve: use of undeclared type or module `two_macros`
|
||||
| ^^^^^^^^^^ use of undeclared type or module `two_macros`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
error[E0659]: `Vec` is ambiguous
|
||||
error[E0659]: `Vec` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:15:9
|
||||
|
|
||||
LL | Vec::panic!(); //~ ERROR `Vec` is ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `Vec` could refer to the name defined here
|
||||
= note: `Vec` could refer to a struct from prelude
|
||||
note: `Vec` could also refer to the extern crate imported here
|
||||
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:7:9
|
||||
|
|
||||
LL | extern crate std as Vec;
|
||||
|
|
@ -12,8 +13,6 @@ LL | extern crate std as Vec;
|
|||
...
|
||||
LL | define_vec!();
|
||||
| -------------- in this macro invocation
|
||||
note: `Vec` could also refer to the name defined here
|
||||
= note: macro-expanded items do not shadow when used in a macro invocation path
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
7
src/test/ui/imports/glob-conflict-cross-crate.rs
Normal file
7
src/test/ui/imports/glob-conflict-cross-crate.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// aux-build:glob-conflict.rs
|
||||
|
||||
extern crate glob_conflict;
|
||||
|
||||
fn main() {
|
||||
glob_conflict::f(); //~ ERROR cannot find function `f` in module `glob_conflict`
|
||||
}
|
||||
9
src/test/ui/imports/glob-conflict-cross-crate.stderr
Normal file
9
src/test/ui/imports/glob-conflict-cross-crate.stderr
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
error[E0425]: cannot find function `f` in module `glob_conflict`
|
||||
--> $DIR/glob-conflict-cross-crate.rs:6:20
|
||||
|
|
||||
LL | glob_conflict::f(); //~ ERROR cannot find function `f` in module `glob_conflict`
|
||||
| ^ not found in `glob_conflict`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0425`.
|
||||
|
|
@ -1,48 +1,50 @@
|
|||
error[E0659]: `env` is ambiguous
|
||||
error[E0659]: `env` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
|
||||
--> $DIR/glob-shadowing.rs:21:17
|
||||
|
|
||||
LL | let x = env!("PATH"); //~ ERROR `env` is ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `env` could refer to the name imported here
|
||||
= note: `env` could refer to a built-in macro
|
||||
note: `env` could also refer to the macro imported here
|
||||
--> $DIR/glob-shadowing.rs:19:9
|
||||
|
|
||||
LL | use m::*;
|
||||
| ^^^^
|
||||
= note: `env` is also a builtin macro
|
||||
= note: consider adding an explicit import of `env` to disambiguate
|
||||
= help: consider adding an explicit import of `env` to disambiguate
|
||||
= help: or use `self::env` to refer to this macro unambiguously
|
||||
|
||||
error[E0659]: `env` is ambiguous
|
||||
error[E0659]: `env` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
|
||||
--> $DIR/glob-shadowing.rs:29:21
|
||||
|
|
||||
LL | let x = env!("PATH"); //~ ERROR `env` is ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `env` could refer to the name imported here
|
||||
= note: `env` could refer to a built-in macro
|
||||
note: `env` could also refer to the macro imported here
|
||||
--> $DIR/glob-shadowing.rs:27:13
|
||||
|
|
||||
LL | use m::*;
|
||||
| ^^^^
|
||||
= note: `env` is also a builtin macro
|
||||
= note: consider adding an explicit import of `env` to disambiguate
|
||||
= help: consider adding an explicit import of `env` to disambiguate
|
||||
|
||||
error[E0659]: `fenv` is ambiguous
|
||||
error[E0659]: `fenv` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
|
||||
--> $DIR/glob-shadowing.rs:39:21
|
||||
|
|
||||
LL | let x = fenv!(); //~ ERROR `fenv` is ambiguous
|
||||
| ^^^^ ambiguous name
|
||||
|
|
||||
note: `fenv` could refer to the name imported here
|
||||
note: `fenv` could refer to the macro imported here
|
||||
--> $DIR/glob-shadowing.rs:37:13
|
||||
|
|
||||
LL | use m::*;
|
||||
| ^^^^
|
||||
note: `fenv` could also refer to the name defined here
|
||||
= help: consider adding an explicit import of `fenv` to disambiguate
|
||||
note: `fenv` could also refer to the macro defined here
|
||||
--> $DIR/glob-shadowing.rs:35:5
|
||||
|
|
||||
LL | pub macro fenv($e: expr) { $e }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: consider adding an explicit import of `fenv` to disambiguate
|
||||
= help: use `self::fenv` to refer to this macro unambiguously
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,24 +2,25 @@ error[E0432]: unresolved import `nonexistent_module`
|
|||
--> $DIR/issue-53269.rs:16:9
|
||||
|
|
||||
LL | use nonexistent_module::mac; //~ ERROR unresolved import `nonexistent_module`
|
||||
| ^^^^^^^^^^^^^^^^^^ Maybe a missing `extern crate nonexistent_module;`?
|
||||
| ^^^^^^^^^^^^^^^^^^ maybe a missing `extern crate nonexistent_module;`?
|
||||
|
||||
error[E0659]: `mac` is ambiguous
|
||||
error[E0659]: `mac` is ambiguous (`macro_rules` vs non-`macro_rules` from other module)
|
||||
--> $DIR/issue-53269.rs:18:5
|
||||
|
|
||||
LL | mac!(); //~ ERROR `mac` is ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `mac` could refer to the name defined here
|
||||
note: `mac` could refer to the macro defined here
|
||||
--> $DIR/issue-53269.rs:13:1
|
||||
|
|
||||
LL | macro_rules! mac { () => () }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: `mac` could also refer to the name imported here
|
||||
note: `mac` could also refer to the unresolved item imported here
|
||||
--> $DIR/issue-53269.rs:16:9
|
||||
|
|
||||
LL | use nonexistent_module::mac; //~ ERROR unresolved import `nonexistent_module`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= help: use `self::mac` to refer to this unresolved item unambiguously
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ error[E0432]: unresolved import `non_existent`
|
|||
--> $DIR/issue-55457.rs:2:5
|
||||
|
|
||||
LL | use non_existent::non_existent; //~ ERROR unresolved import `non_existent`
|
||||
| ^^^^^^^^^^^^ Maybe a missing `extern crate non_existent;`?
|
||||
| ^^^^^^^^^^^^ maybe a missing `extern crate non_existent;`?
|
||||
|
||||
error: cannot determine resolution for the derive macro `NonExistent`
|
||||
--> $DIR/issue-55457.rs:5:10
|
||||
|
|
|
|||
21
src/test/ui/imports/issue-55884-1.rs
Normal file
21
src/test/ui/imports/issue-55884-1.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
mod m {
|
||||
mod m1 {
|
||||
pub struct S {}
|
||||
}
|
||||
mod m2 {
|
||||
// Note this derive, it makes this struct macro-expanded,
|
||||
// so it doesn't appear in time to participate in the initial resolution of `use m::S`,
|
||||
// only in the later validation pass.
|
||||
#[derive(Default)]
|
||||
pub struct S {}
|
||||
}
|
||||
|
||||
// Create a glob vs glob ambiguity
|
||||
pub use self::m1::*;
|
||||
pub use self::m2::*;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
use m::S; //~ ERROR `S` is ambiguous
|
||||
let s = S {};
|
||||
}
|
||||
22
src/test/ui/imports/issue-55884-1.stderr
Normal file
22
src/test/ui/imports/issue-55884-1.stderr
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
error[E0659]: `S` is ambiguous (glob import vs glob import in the same module)
|
||||
--> $DIR/issue-55884-1.rs:19:12
|
||||
|
|
||||
LL | use m::S; //~ ERROR `S` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `S` could refer to the struct imported here
|
||||
--> $DIR/issue-55884-1.rs:14:13
|
||||
|
|
||||
LL | pub use self::m1::*;
|
||||
| ^^^^^^^^^^^
|
||||
= help: consider adding an explicit import of `S` to disambiguate
|
||||
note: `S` could also refer to the struct imported here
|
||||
--> $DIR/issue-55884-1.rs:15:13
|
||||
|
|
||||
LL | pub use self::m2::*;
|
||||
| ^^^^^^^^^^^
|
||||
= help: consider adding an explicit import of `S` to disambiguate
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0659`.
|
||||
14
src/test/ui/imports/issue-55884-2.rs
Normal file
14
src/test/ui/imports/issue-55884-2.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
mod options {
|
||||
pub struct ParseOptions {}
|
||||
}
|
||||
|
||||
mod parser {
|
||||
pub use options::*;
|
||||
// Private single import shadows public glob import, but arrives too late for initial
|
||||
// resolution of `use parser::ParseOptions` because it depends on that resolution itself.
|
||||
use ParseOptions;
|
||||
}
|
||||
|
||||
pub use parser::ParseOptions; //~ ERROR struct `ParseOptions` is private
|
||||
|
||||
fn main() {}
|
||||
9
src/test/ui/imports/issue-55884-2.stderr
Normal file
9
src/test/ui/imports/issue-55884-2.stderr
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
error[E0603]: struct `ParseOptions` is private
|
||||
--> $DIR/issue-55884-2.rs:12:17
|
||||
|
|
||||
LL | pub use parser::ParseOptions; //~ ERROR struct `ParseOptions` is private
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0603`.
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
error[E0659]: `exported` is ambiguous
|
||||
error[E0659]: `exported` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution)
|
||||
--> $DIR/local-modularized-tricky-fail-1.rs:38:1
|
||||
|
|
||||
LL | exported!(); //~ ERROR `exported` is ambiguous
|
||||
| ^^^^^^^^ ambiguous name
|
||||
|
|
||||
note: `exported` could refer to the name defined here
|
||||
note: `exported` could refer to the macro defined here
|
||||
--> $DIR/local-modularized-tricky-fail-1.rs:15:5
|
||||
|
|
||||
LL | / macro_rules! exported {
|
||||
|
|
@ -14,20 +14,21 @@ LL | | }
|
|||
...
|
||||
LL | define_exported!();
|
||||
| ------------------- in this macro invocation
|
||||
note: `exported` could also refer to the name imported here
|
||||
note: `exported` could also refer to the macro imported here
|
||||
--> $DIR/local-modularized-tricky-fail-1.rs:32:5
|
||||
|
|
||||
LL | use inner1::*;
|
||||
| ^^^^^^^^^
|
||||
= note: macro-expanded macros do not shadow
|
||||
= help: consider adding an explicit import of `exported` to disambiguate
|
||||
|
||||
error[E0659]: `include` is ambiguous
|
||||
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
|
||||
|
|
||||
LL | include!(); //~ ERROR `include` is ambiguous
|
||||
| ^^^^^^^ ambiguous name
|
||||
|
|
||||
note: `include` could refer to the name defined here
|
||||
= note: `include` could refer to a built-in macro
|
||||
note: `include` could also refer to the macro defined here
|
||||
--> $DIR/local-modularized-tricky-fail-1.rs:27:5
|
||||
|
|
||||
LL | / macro_rules! include {
|
||||
|
|
@ -37,16 +38,16 @@ LL | | }
|
|||
...
|
||||
LL | define_include!();
|
||||
| ------------------ in this macro invocation
|
||||
= note: `include` is also a builtin macro
|
||||
= note: macro-expanded macros do not shadow
|
||||
= help: use `self::include` to refer to this macro unambiguously
|
||||
|
||||
error[E0659]: `panic` is ambiguous
|
||||
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
|
||||
|
|
||||
LL | panic!(); //~ ERROR `panic` is ambiguous
|
||||
| ^^^^^ ambiguous name
|
||||
|
|
||||
note: `panic` could refer to the name defined here
|
||||
= note: `panic` could refer to a macro from prelude
|
||||
note: `panic` could also refer to the macro defined here
|
||||
--> $DIR/local-modularized-tricky-fail-1.rs:21:5
|
||||
|
|
||||
LL | / macro_rules! panic {
|
||||
|
|
@ -56,16 +57,16 @@ LL | | }
|
|||
...
|
||||
LL | define_panic!();
|
||||
| ---------------- in this macro invocation
|
||||
= note: `panic` is also a builtin macro
|
||||
= note: macro-expanded macros do not shadow
|
||||
= help: use `self::panic` to refer to this macro unambiguously
|
||||
|
||||
error[E0659]: `panic` is ambiguous
|
||||
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
|
||||
|
|
||||
LL | ( ) => ( { panic ! ( "explicit panic" ) } ) ; ( $ msg : expr ) => (
|
||||
| ^^^^^ ambiguous name
|
||||
|
|
||||
note: `panic` could refer to the name defined here
|
||||
= note: `panic` could refer to a macro from prelude
|
||||
note: `panic` could also refer to the macro defined here
|
||||
--> $DIR/local-modularized-tricky-fail-1.rs:21:5
|
||||
|
|
||||
LL | / macro_rules! panic {
|
||||
|
|
@ -75,8 +76,7 @@ LL | | }
|
|||
...
|
||||
LL | define_panic!();
|
||||
| ---------------- in this macro invocation
|
||||
= note: `panic` is also a builtin macro
|
||||
= note: macro-expanded macros do not shadow
|
||||
= help: use `self::panic` to refer to this macro unambiguously
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,40 +1,40 @@
|
|||
error[E0659]: `bar` is ambiguous
|
||||
error[E0659]: `bar` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution)
|
||||
--> $DIR/macro-paths.rs:23:5
|
||||
|
|
||||
LL | bar::m! { //~ ERROR ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `bar` could refer to the name defined here
|
||||
note: `bar` could refer to the module defined here
|
||||
--> $DIR/macro-paths.rs:24:9
|
||||
|
|
||||
LL | mod bar { pub use two_macros::m; }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: `bar` could also refer to the name imported here
|
||||
note: `bar` could also refer to the module imported here
|
||||
--> $DIR/macro-paths.rs:22:9
|
||||
|
|
||||
LL | use foo::*;
|
||||
| ^^^^^^
|
||||
= note: macro-expanded items do not shadow when used in a macro invocation path
|
||||
= help: consider adding an explicit import of `bar` to disambiguate
|
||||
|
||||
error[E0659]: `baz` is ambiguous
|
||||
error[E0659]: `baz` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/macro-paths.rs:33:5
|
||||
|
|
||||
LL | baz::m! { //~ ERROR ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `baz` could refer to the name defined here
|
||||
note: `baz` could refer to the module defined here
|
||||
--> $DIR/macro-paths.rs:34:9
|
||||
|
|
||||
LL | mod baz { pub use two_macros::m; }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: `baz` could also refer to the name defined here
|
||||
note: `baz` could also refer to the module defined here
|
||||
--> $DIR/macro-paths.rs:28:1
|
||||
|
|
||||
LL | / pub mod baz {
|
||||
LL | | pub use two_macros::m;
|
||||
LL | | }
|
||||
| |_^
|
||||
= note: macro-expanded items do not shadow when used in a macro invocation path
|
||||
= help: use `self::baz` to refer to this module unambiguously
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,38 +1,38 @@
|
|||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution)
|
||||
--> $DIR/macros.rs:26:5
|
||||
|
|
||||
LL | m! { //~ ERROR ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name imported here
|
||||
note: `m` could refer to the macro imported here
|
||||
--> $DIR/macros.rs:27:13
|
||||
|
|
||||
LL | use foo::m;
|
||||
| ^^^^^^
|
||||
note: `m` could also refer to the name imported here
|
||||
note: `m` could also refer to the macro imported here
|
||||
--> $DIR/macros.rs:25:9
|
||||
|
|
||||
LL | use two_macros::*;
|
||||
| ^^^^^^^^^^^^^
|
||||
= note: macro-expanded macro imports do not shadow
|
||||
= help: consider adding an explicit import of `m` to disambiguate
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/macros.rs:39:9
|
||||
|
|
||||
LL | m! { //~ ERROR ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name imported here
|
||||
note: `m` could refer to the macro imported here
|
||||
--> $DIR/macros.rs:40:17
|
||||
|
|
||||
LL | use two_macros::n as m;
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
note: `m` could also refer to the name imported here
|
||||
note: `m` could also refer to the macro imported here
|
||||
--> $DIR/macros.rs:32:9
|
||||
|
|
||||
LL | use two_macros::m;
|
||||
| ^^^^^^^^^^^^^
|
||||
= note: macro-expanded macro imports do not shadow
|
||||
= help: use `self::m` to refer to this macro unambiguously
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,21 @@
|
|||
error[E0659]: `Foo` is ambiguous
|
||||
error[E0659]: `Foo` is ambiguous (glob import vs glob import in the same module)
|
||||
--> $DIR/rfc-1560-warning-cycle.rs:19:17
|
||||
|
|
||||
LL | fn f(_: Foo) {} //~ ERROR `Foo` is ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `Foo` could refer to the name imported here
|
||||
note: `Foo` could refer to the struct imported here
|
||||
--> $DIR/rfc-1560-warning-cycle.rs:17:13
|
||||
|
|
||||
LL | use *;
|
||||
| ^
|
||||
note: `Foo` could also refer to the name imported here
|
||||
= help: consider adding an explicit import of `Foo` to disambiguate
|
||||
note: `Foo` could also refer to the struct imported here
|
||||
--> $DIR/rfc-1560-warning-cycle.rs:18:13
|
||||
|
|
||||
LL | use bar::*;
|
||||
| ^^^^^^
|
||||
= note: consider adding an explicit import of `Foo` to disambiguate
|
||||
= help: consider adding an explicit import of `Foo` to disambiguate
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,38 +1,40 @@
|
|||
error[E0659]: `panic` is ambiguous
|
||||
error[E0659]: `panic` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
|
||||
--> $DIR/shadow_builtin_macros.rs:25:14
|
||||
|
|
||||
LL | fn f() { panic!(); } //~ ERROR ambiguous
|
||||
| ^^^^^ ambiguous name
|
||||
|
|
||||
note: `panic` could refer to the name imported here
|
||||
= note: `panic` could refer to a macro from prelude
|
||||
note: `panic` could also refer to the macro imported here
|
||||
--> $DIR/shadow_builtin_macros.rs:24:9
|
||||
|
|
||||
LL | use foo::*;
|
||||
| ^^^^^^
|
||||
= note: `panic` is also a builtin macro
|
||||
= note: consider adding an explicit import of `panic` to disambiguate
|
||||
= help: consider adding an explicit import of `panic` to disambiguate
|
||||
= help: or use `self::panic` to refer to this macro unambiguously
|
||||
|
||||
error[E0659]: `panic` is ambiguous
|
||||
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
|
||||
|
|
||||
LL | fn f() { panic!(); } //~ ERROR ambiguous
|
||||
| ^^^^^ ambiguous name
|
||||
|
|
||||
note: `panic` could refer to the name imported here
|
||||
= note: `panic` could refer to a macro from prelude
|
||||
note: `panic` could also refer to the macro imported here
|
||||
--> $DIR/shadow_builtin_macros.rs:29:26
|
||||
|
|
||||
LL | ::two_macros::m!(use foo::panic;);
|
||||
| ^^^^^^^^^^
|
||||
= note: `panic` is also a builtin macro
|
||||
= note: macro-expanded macro imports do not shadow
|
||||
= help: use `self::panic` to refer to this macro unambiguously
|
||||
|
||||
error[E0659]: `panic` is ambiguous
|
||||
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
|
||||
|
|
||||
LL | panic!(); //~ ERROR `panic` is ambiguous
|
||||
| ^^^^^ ambiguous name
|
||||
|
|
||||
note: `panic` could refer to the name defined here
|
||||
= note: `panic` could refer to a macro from prelude
|
||||
note: `panic` could also refer to the macro defined here
|
||||
--> $DIR/shadow_builtin_macros.rs:40:9
|
||||
|
|
||||
LL | macro_rules! panic { () => {} }
|
||||
|
|
@ -40,26 +42,25 @@ LL | macro_rules! panic { () => {} }
|
|||
LL | } }
|
||||
LL | m!();
|
||||
| ----- in this macro invocation
|
||||
= note: `panic` is also a builtin macro
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `n` is ambiguous
|
||||
error[E0659]: `n` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
|
||||
--> $DIR/shadow_builtin_macros.rs:59:5
|
||||
|
|
||||
LL | n!(); //~ ERROR ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `n` could refer to the name imported here
|
||||
note: `n` could refer to the macro imported here
|
||||
--> $DIR/shadow_builtin_macros.rs:58:9
|
||||
|
|
||||
LL | use bar::*;
|
||||
| ^^^^^^
|
||||
note: `n` could also refer to the name imported here
|
||||
= help: consider adding an explicit import of `n` to disambiguate
|
||||
= 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
|
||||
|
|
||||
LL | #[macro_use(n)]
|
||||
| ^
|
||||
= note: consider adding an explicit import of `n` to disambiguate
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@
|
|||
// Testing that we don't fail abnormally after hitting the errors
|
||||
|
||||
use unresolved::*; //~ ERROR unresolved import `unresolved` [E0432]
|
||||
//~^ Maybe a missing `extern crate unresolved;`?
|
||||
//~^ maybe a missing `extern crate unresolved;`?
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0432]: unresolved import `unresolved`
|
|||
--> $DIR/issue-1697.rs:13:5
|
||||
|
|
||||
LL | use unresolved::*; //~ ERROR unresolved import `unresolved` [E0432]
|
||||
| ^^^^^^^^^^ Maybe a missing `extern crate unresolved;`?
|
||||
| ^^^^^^^^^^ maybe a missing `extern crate unresolved;`?
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@
|
|||
type Alias = ();
|
||||
use Alias::*;
|
||||
//~^ ERROR unresolved import `Alias` [E0432]
|
||||
//~| Not a module `Alias`
|
||||
//~| not a module `Alias`
|
||||
use std::io::Result::*;
|
||||
//~^ ERROR unresolved import `std::io::Result` [E0432]
|
||||
//~| Not a module `Result`
|
||||
//~| not a module `Result`
|
||||
|
||||
trait T {}
|
||||
use T::*; //~ ERROR items in traits are not importable
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ error[E0432]: unresolved import `Alias`
|
|||
--> $DIR/issue-30560.rs:12:5
|
||||
|
|
||||
LL | use Alias::*;
|
||||
| ^^^^^ Not a module `Alias`
|
||||
| ^^^^^ not a module `Alias`
|
||||
|
||||
error[E0432]: unresolved import `std::io::Result`
|
||||
--> $DIR/issue-30560.rs:15:14
|
||||
|
|
||||
LL | use std::io::Result::*;
|
||||
| ^^^^^^ Not a module `Result`
|
||||
| ^^^^^^ not a module `Result`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@
|
|||
fn main() {
|
||||
match 0 {
|
||||
aaa::bbb(_) => ()
|
||||
//~^ ERROR failed to resolve. Use of undeclared type or module `aaa`
|
||||
//~^ ERROR failed to resolve: use of undeclared type or module `aaa`
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. Use of undeclared type or module `aaa`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `aaa`
|
||||
--> $DIR/issue-33293.rs:13:9
|
||||
|
|
||||
LL | aaa::bbb(_) => ()
|
||||
| ^^^ Use of undeclared type or module `aaa`
|
||||
| ^^^ use of undeclared type or module `aaa`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@ error[E0432]: unresolved import `abc`
|
|||
--> $DIR/issue-33464.rs:13:5
|
||||
|
|
||||
LL | use abc::one_el;
|
||||
| ^^^ Maybe a missing `extern crate abc;`?
|
||||
| ^^^ maybe a missing `extern crate abc;`?
|
||||
|
||||
error[E0432]: unresolved import `abc`
|
||||
--> $DIR/issue-33464.rs:15:5
|
||||
|
|
||||
LL | use abc::{a, bbb, cccccc};
|
||||
| ^^^ Maybe a missing `extern crate abc;`?
|
||||
| ^^^ maybe a missing `extern crate abc;`?
|
||||
|
||||
error[E0432]: unresolved import `a_very_long_name`
|
||||
--> $DIR/issue-33464.rs:17:5
|
||||
|
|
||||
LL | use a_very_long_name::{el, el2};
|
||||
| ^^^^^^^^^^^^^^^^ Maybe a missing `extern crate a_very_long_name;`?
|
||||
| ^^^^^^^^^^^^^^^^ maybe a missing `extern crate a_very_long_name;`?
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0432]: unresolved import `issue_36881_aux`
|
|||
--> $DIR/issue-36881.rs:16:9
|
||||
|
|
||||
LL | use issue_36881_aux::Foo; //~ ERROR unresolved import
|
||||
| ^^^^^^^^^^^^^^^ Maybe a missing `extern crate issue_36881_aux;`?
|
||||
| ^^^^^^^^^^^^^^^ maybe a missing `extern crate issue_36881_aux;`?
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0432]: unresolved import `libc`
|
|||
--> $DIR/issue-37887.rs:13:9
|
||||
|
|
||||
LL | use libc::*; //~ ERROR unresolved import
|
||||
| ^^^^ Maybe a missing `extern crate libc;`?
|
||||
| ^^^^ maybe a missing `extern crate libc;`?
|
||||
|
||||
error[E0658]: use of unstable library feature 'libc': use `libc` from crates.io (see issue #27783)
|
||||
--> $DIR/issue-37887.rs:12:5
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
fn main() {
|
||||
let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() };
|
||||
//~^ ERROR failed to resolve. Could not find `imp` in `sys` [E0433]
|
||||
//~^ ERROR failed to resolve: could not find `imp` in `sys` [E0433]
|
||||
//~^^ ERROR module `sys` is private [E0603]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. Could not find `imp` in `sys`
|
||||
error[E0433]: failed to resolve: could not find `imp` in `sys`
|
||||
--> $DIR/issue-38857.rs:12:23
|
||||
|
|
||||
LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() };
|
||||
| ^^^ Could not find `imp` in `sys`
|
||||
| ^^^ could not find `imp` in `sys`
|
||||
|
||||
error[E0603]: module `sys` is private
|
||||
--> $DIR/issue-38857.rs:12:18
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
let super = 22; //~ ERROR failed to resolve. There are too many initial `super`s
|
||||
let super = 22; //~ ERROR failed to resolve: there are too many initial `super`s
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. There are too many initial `super`s.
|
||||
error[E0433]: failed to resolve: there are too many initial `super`s.
|
||||
--> $DIR/keyword-super-as-identifier.rs:12:9
|
||||
|
|
||||
LL | let super = 22; //~ ERROR failed to resolve. There are too many initial `super`s
|
||||
| ^^^^^ There are too many initial `super`s.
|
||||
LL | let super = 22; //~ ERROR failed to resolve: there are too many initial `super`s
|
||||
| ^^^^^ there are too many initial `super`s.
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
let super: isize; //~ ERROR failed to resolve. There are too many initial `super`s
|
||||
let super: isize; //~ ERROR failed to resolve: there are too many initial `super`s
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. There are too many initial `super`s.
|
||||
error[E0433]: failed to resolve: there are too many initial `super`s.
|
||||
--> $DIR/keyword-super.rs:12:9
|
||||
|
|
||||
LL | let super: isize; //~ ERROR failed to resolve. There are too many initial `super`s
|
||||
| ^^^^^ There are too many initial `super`s.
|
||||
LL | let super: isize; //~ ERROR failed to resolve: there are too many initial `super`s
|
||||
| ^^^^^ there are too many initial `super`s.
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,32 +1,32 @@
|
|||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (`macro_rules` vs non-`macro_rules` from other module)
|
||||
--> $DIR/ambiguity-legacy-vs-modern.rs:31:9
|
||||
|
|
||||
LL | m!() //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/ambiguity-legacy-vs-modern.rs:26:5
|
||||
|
|
||||
LL | macro_rules! m { () => (()) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/ambiguity-legacy-vs-modern.rs:29:9
|
||||
|
|
||||
LL | macro m() { 0 }
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (`macro_rules` vs non-`macro_rules` from other module)
|
||||
--> $DIR/ambiguity-legacy-vs-modern.rs:43:5
|
||||
|
|
||||
LL | m!() //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/ambiguity-legacy-vs-modern.rs:40:9
|
||||
|
|
||||
LL | macro_rules! m { () => (()) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/ambiguity-legacy-vs-modern.rs:36:5
|
||||
|
|
||||
LL | macro m() { 0 }
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ test!(b,
|
|||
#[qux]
|
||||
fn main() {
|
||||
a::bar();
|
||||
//~^ ERROR failed to resolve. Use of undeclared type or module `a`
|
||||
//~^ ERROR failed to resolve: use of undeclared type or module `a`
|
||||
b::bar();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. Use of undeclared type or module `a`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `a`
|
||||
--> $DIR/macro-inner-attributes.rs:27:5
|
||||
|
|
||||
LL | a::bar();
|
||||
| ^ Use of undeclared type or module `a`
|
||||
| ^ use of undeclared type or module `a`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
mod m {
|
||||
fn check() {
|
||||
Vec::clone!(); //~ ERROR failed to resolve. Not a module `Vec`
|
||||
u8::clone!(); //~ ERROR failed to resolve. Not a module `u8`
|
||||
Vec::clone!(); //~ ERROR failed to resolve: not a module `Vec`
|
||||
u8::clone!(); //~ ERROR failed to resolve: not a module `u8`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
error[E0433]: failed to resolve. Not a module `Vec`
|
||||
error[E0433]: failed to resolve: not a module `Vec`
|
||||
--> $DIR/macro-path-prelude-fail-1.rs:15:9
|
||||
|
|
||||
LL | Vec::clone!(); //~ ERROR failed to resolve. Not a module `Vec`
|
||||
| ^^^ Not a module `Vec`
|
||||
LL | Vec::clone!(); //~ ERROR failed to resolve: not a module `Vec`
|
||||
| ^^^ not a module `Vec`
|
||||
|
||||
error[E0433]: failed to resolve. Not a module `u8`
|
||||
error[E0433]: failed to resolve: not a module `u8`
|
||||
--> $DIR/macro-path-prelude-fail-1.rs:16:9
|
||||
|
|
||||
LL | u8::clone!(); //~ ERROR failed to resolve. Not a module `u8`
|
||||
| ^^ Not a module `u8`
|
||||
LL | u8::clone!(); //~ ERROR failed to resolve: not a module `u8`
|
||||
| ^^ not a module `u8`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
mod m {
|
||||
fn check() {
|
||||
Result::Ok!(); //~ ERROR fail to resolve non-ident macro path
|
||||
Result::Ok!(); //~ ERROR failed to resolve: partially resolved path in a macro
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
error: fail to resolve non-ident macro path
|
||||
error[E0433]: failed to resolve: partially resolved path in a macro
|
||||
--> $DIR/macro-path-prelude-fail-2.rs:13:9
|
||||
|
|
||||
LL | Result::Ok!(); //~ ERROR fail to resolve non-ident macro path
|
||||
| ^^^^^^^^^^
|
||||
LL | Result::Ok!(); //~ ERROR failed to resolve: partially resolved path in a macro
|
||||
| ^^^^^^^^^^ partially resolved path in a macro
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0433`.
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
error[E0659]: `std` is ambiguous
|
||||
error[E0659]: `std` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
|
||||
--> $DIR/macro-path-prelude-shadowing.rs:39:9
|
||||
|
|
||||
LL | std::panic!(); //~ ERROR `std` is ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `std` could refer to the name imported here
|
||||
= note: `std` could refer to a built-in extern crate
|
||||
note: `std` could also refer to the module imported here
|
||||
--> $DIR/macro-path-prelude-shadowing.rs:37:9
|
||||
|
|
||||
LL | use m2::*; // glob-import user-defined `std`
|
||||
| ^^^^^
|
||||
note: `std` could also refer to the name defined here
|
||||
= note: consider adding an explicit import of `std` to disambiguate
|
||||
= help: consider adding an explicit import of `std` to disambiguate
|
||||
= help: or use `self::std` to refer to this module unambiguously
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ LL | m1!();
|
|||
|
|
||||
= note: macro-expanded `#[macro_use]`s may not shadow existing macros (see RFC 1560)
|
||||
|
||||
error[E0659]: `foo` is ambiguous
|
||||
error[E0659]: `foo` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/macro-shadowing.rs:27:1
|
||||
|
|
||||
LL | foo!(); //~ ERROR `foo` is ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `foo` could refer to the name defined here
|
||||
note: `foo` could refer to the macro defined here
|
||||
--> $DIR/macro-shadowing.rs:20:5
|
||||
|
|
||||
LL | macro_rules! foo { () => {} }
|
||||
|
|
@ -23,12 +23,11 @@ LL | macro_rules! foo { () => {} }
|
|||
...
|
||||
LL | m1!();
|
||||
| ------ in this macro invocation
|
||||
note: `foo` could also refer to the name defined here
|
||||
note: `foo` could also refer to the macro defined here
|
||||
--> $DIR/macro-shadowing.rs:15:1
|
||||
|
|
||||
LL | macro_rules! foo { () => {} }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. Use of undeclared type or module `m`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `m`
|
||||
--> $DIR/macro_path_as_generic_bound.rs:17:6
|
||||
|
|
||||
LL | foo!(m::m2::A); //~ ERROR failed to resolve
|
||||
| ^ Use of undeclared type or module `m`
|
||||
| ^ use of undeclared type or module `m`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-legacy.rs:101:13
|
||||
|
|
||||
LL | m!(); //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:88:9
|
||||
|
|
||||
LL | macro_rules! m { () => { Right } }
|
||||
|
|
@ -12,7 +12,7 @@ LL | macro_rules! m { () => { Right } }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:97:9
|
||||
|
|
||||
LL | macro_rules! m { () => {} }
|
||||
|
|
@ -20,15 +20,14 @@ LL | macro_rules! m { () => {} }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-legacy.rs:139:42
|
||||
|
|
||||
LL | macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:88:9
|
||||
|
|
||||
LL | macro_rules! m { () => { Right } }
|
||||
|
|
@ -36,7 +35,7 @@ LL | macro_rules! m { () => { Right } }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:135:9
|
||||
|
|
||||
LL | macro_rules! m { () => {} }
|
||||
|
|
@ -44,15 +43,14 @@ LL | macro_rules! m { () => {} }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-legacy.rs:148:9
|
||||
|
|
||||
LL | m!(); //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:88:9
|
||||
|
|
||||
LL | macro_rules! m { () => { Right } }
|
||||
|
|
@ -60,7 +58,7 @@ LL | macro_rules! m { () => { Right } }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:144:9
|
||||
|
|
||||
LL | macro_rules! m { () => {} }
|
||||
|
|
@ -68,15 +66,14 @@ LL | macro_rules! m { () => {} }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-legacy.rs:164:9
|
||||
|
|
||||
LL | m!(); //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:88:9
|
||||
|
|
||||
LL | macro_rules! m { () => { Right } }
|
||||
|
|
@ -84,7 +81,7 @@ LL | macro_rules! m { () => { Right } }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:85:9
|
||||
|
|
||||
LL | macro_rules! m { () => { Wrong } }
|
||||
|
|
@ -92,15 +89,14 @@ LL | macro_rules! m { () => { Wrong } }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-legacy.rs:180:13
|
||||
|
|
||||
LL | m!(); //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:88:9
|
||||
|
|
||||
LL | macro_rules! m { () => { Right } }
|
||||
|
|
@ -108,7 +104,7 @@ LL | macro_rules! m { () => { Right } }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:85:9
|
||||
|
|
||||
LL | macro_rules! m { () => { Wrong } }
|
||||
|
|
@ -116,15 +112,14 @@ LL | macro_rules! m { () => { Wrong } }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-legacy.rs:218:42
|
||||
|
|
||||
LL | macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:88:9
|
||||
|
|
||||
LL | macro_rules! m { () => { Right } }
|
||||
|
|
@ -132,7 +127,7 @@ LL | macro_rules! m { () => { Right } }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:85:9
|
||||
|
|
||||
LL | macro_rules! m { () => { Wrong } }
|
||||
|
|
@ -140,15 +135,14 @@ LL | macro_rules! m { () => { Wrong } }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-legacy.rs:232:9
|
||||
|
|
||||
LL | m!(); //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:88:9
|
||||
|
|
||||
LL | macro_rules! m { () => { Right } }
|
||||
|
|
@ -156,7 +150,7 @@ LL | macro_rules! m { () => { Right } }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:227:13
|
||||
|
|
||||
LL | macro_rules! m { () => {} }
|
||||
|
|
@ -164,15 +158,14 @@ LL | macro_rules! m { () => {} }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-legacy.rs:262:42
|
||||
|
|
||||
LL | macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:88:9
|
||||
|
|
||||
LL | macro_rules! m { () => { Right } }
|
||||
|
|
@ -180,7 +173,7 @@ LL | macro_rules! m { () => { Right } }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-legacy.rs:257:13
|
||||
|
|
||||
LL | macro_rules! m { () => {} }
|
||||
|
|
@ -188,7 +181,6 @@ LL | macro_rules! m { () => {} }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-modern.rs:106:17
|
||||
|
|
||||
LL | m!(); //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-modern.rs:91:9
|
||||
|
|
||||
LL | macro m() { Right }
|
||||
|
|
@ -12,7 +12,7 @@ LL | macro m() { Right }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-modern.rs:101:9
|
||||
|
|
||||
LL | macro m() {}
|
||||
|
|
@ -20,15 +20,14 @@ LL | macro m() {}
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-modern.rs:149:33
|
||||
|
|
||||
LL | macro gen_invoc() { m!() } //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-modern.rs:91:9
|
||||
|
|
||||
LL | macro m() { Right }
|
||||
|
|
@ -36,7 +35,7 @@ LL | macro m() { Right }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-modern.rs:145:9
|
||||
|
|
||||
LL | macro m() {}
|
||||
|
|
@ -44,15 +43,14 @@ LL | macro m() {}
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-modern.rs:158:13
|
||||
|
|
||||
LL | m!(); //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-modern.rs:91:9
|
||||
|
|
||||
LL | macro m() { Right }
|
||||
|
|
@ -60,7 +58,7 @@ LL | macro m() { Right }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-modern.rs:155:9
|
||||
|
|
||||
LL | macro m() {}
|
||||
|
|
@ -68,15 +66,14 @@ LL | macro m() {}
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-modern.rs:174:13
|
||||
|
|
||||
LL | m!(); //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-modern.rs:91:9
|
||||
|
|
||||
LL | macro m() { Right }
|
||||
|
|
@ -84,7 +81,7 @@ LL | macro m() { Right }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-modern.rs:87:9
|
||||
|
|
||||
LL | macro m() { Wrong }
|
||||
|
|
@ -92,15 +89,14 @@ LL | macro m() { Wrong }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-modern.rs:192:17
|
||||
|
|
||||
LL | m!(); //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-modern.rs:91:9
|
||||
|
|
||||
LL | macro m() { Right }
|
||||
|
|
@ -108,7 +104,7 @@ LL | macro m() { Right }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-modern.rs:87:9
|
||||
|
|
||||
LL | macro m() { Wrong }
|
||||
|
|
@ -116,15 +112,14 @@ LL | macro m() { Wrong }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error[E0659]: `m` is ambiguous
|
||||
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/restricted-shadowing-modern.rs:235:33
|
||||
|
|
||||
LL | macro gen_invoc() { m!() } //~ ERROR `m` is ambiguous
|
||||
| ^ ambiguous name
|
||||
|
|
||||
note: `m` could refer to the name defined here
|
||||
note: `m` could refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-modern.rs:91:9
|
||||
|
|
||||
LL | macro m() { Right }
|
||||
|
|
@ -132,7 +127,7 @@ LL | macro m() { Right }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
note: `m` could also refer to the name defined here
|
||||
note: `m` could also refer to the macro defined here
|
||||
--> $DIR/restricted-shadowing-modern.rs:87:9
|
||||
|
|
||||
LL | macro m() { Wrong }
|
||||
|
|
@ -140,7 +135,6 @@ LL | macro m() { Wrong }
|
|||
...
|
||||
LL | include!();
|
||||
| ----------- in this macro invocation
|
||||
= note: macro-expanded macros do not shadow
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,19 @@
|
|||
error[E0659]: `bar` is ambiguous
|
||||
error[E0659]: `bar` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
|
||||
--> $DIR/out-of-order-shadowing.rs:15:1
|
||||
|
|
||||
LL | bar!(); //~ ERROR `bar` is ambiguous
|
||||
| ^^^ ambiguous name
|
||||
|
|
||||
note: `bar` could refer to the name defined here
|
||||
note: `bar` could refer to the macro defined here
|
||||
--> $DIR/out-of-order-shadowing.rs:14:1
|
||||
|
|
||||
LL | define_macro!(bar);
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
note: `bar` could also refer to the name defined here
|
||||
note: `bar` could also refer to the macro defined here
|
||||
--> $DIR/out-of-order-shadowing.rs:13:1
|
||||
|
|
||||
LL | macro_rules! bar { () => {} }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: macro-expanded macros do not shadow
|
||||
= 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 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
|
||||
|
|
|
|||
|
|
@ -42,6 +42,6 @@ fn main() {
|
|||
//~| expected char, found bool
|
||||
|
||||
match () {
|
||||
E::V => {} //~ ERROR failed to resolve. Use of undeclared type or module `E`
|
||||
E::V => {} //~ ERROR failed to resolve: use of undeclared type or module `E`
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. Use of undeclared type or module `E`
|
||||
error[E0433]: failed to resolve: use of undeclared type or module `E`
|
||||
--> $DIR/pattern-error-continue.rs:45:9
|
||||
|
|
||||
LL | E::V => {} //~ ERROR failed to resolve. Use of undeclared type or module `E`
|
||||
| ^ Use of undeclared type or module `E`
|
||||
LL | E::V => {} //~ ERROR failed to resolve: use of undeclared type or module `E`
|
||||
| ^ use of undeclared type or module `E`
|
||||
|
||||
error[E0532]: expected tuple struct/variant, found unit variant `A::D`
|
||||
--> $DIR/pattern-error-continue.rs:28:9
|
||||
|
|
|
|||
9
src/test/ui/privacy/decl-macro.rs
Normal file
9
src/test/ui/privacy/decl-macro.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![feature(decl_macro)]
|
||||
|
||||
mod m {
|
||||
macro mac() {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
m::mac!(); //~ ERROR macro `mac` is private
|
||||
}
|
||||
9
src/test/ui/privacy/decl-macro.stderr
Normal file
9
src/test/ui/privacy/decl-macro.stderr
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
error[E0603]: macro `mac` is private
|
||||
--> $DIR/decl-macro.rs:8:8
|
||||
|
|
||||
LL | m::mac!(); //~ ERROR macro `mac` is private
|
||||
| ^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0603`.
|
||||
|
|
@ -57,6 +57,6 @@ fn main() {
|
|||
}
|
||||
|
||||
mod pathological {
|
||||
pub(in bad::path) mod m1 {} //~ ERROR failed to resolve. Maybe a missing `extern crate bad;`?
|
||||
pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: maybe a missing `extern crate bad;`?
|
||||
pub(in foo) mod m2 {} //~ ERROR visibilities can only be restricted to ancestor modules
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. Maybe a missing `extern crate bad;`?
|
||||
error[E0433]: failed to resolve: maybe a missing `extern crate bad;`?
|
||||
--> $DIR/test.rs:60:12
|
||||
|
|
||||
LL | pub(in bad::path) mod m1 {} //~ ERROR failed to resolve. Maybe a missing `extern crate bad;`?
|
||||
| ^^^ Maybe a missing `extern crate bad;`?
|
||||
LL | pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: maybe a missing `extern crate bad;`?
|
||||
| ^^^ maybe a missing `extern crate bad;`?
|
||||
|
||||
error: visibilities can only be restricted to ancestor modules
|
||||
--> $DIR/test.rs:61:12
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@ enum E { V }
|
|||
use E::V;
|
||||
|
||||
fn main() {
|
||||
E::V::associated_item; //~ ERROR failed to resolve. Not a module `V`
|
||||
V::associated_item; //~ ERROR failed to resolve. Not a module `V`
|
||||
E::V::associated_item; //~ ERROR failed to resolve: not a module `V`
|
||||
V::associated_item; //~ ERROR failed to resolve: not a module `V`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
error[E0433]: failed to resolve. Not a module `V`
|
||||
error[E0433]: failed to resolve: not a module `V`
|
||||
--> $DIR/resolve-variant-assoc-item.rs:15:8
|
||||
|
|
||||
LL | E::V::associated_item; //~ ERROR failed to resolve. Not a module `V`
|
||||
| ^ Not a module `V`
|
||||
LL | E::V::associated_item; //~ ERROR failed to resolve: not a module `V`
|
||||
| ^ not a module `V`
|
||||
|
||||
error[E0433]: failed to resolve. Not a module `V`
|
||||
error[E0433]: failed to resolve: not a module `V`
|
||||
--> $DIR/resolve-variant-assoc-item.rs:16:5
|
||||
|
|
||||
LL | V::associated_item; //~ ERROR failed to resolve. Not a module `V`
|
||||
| ^ Not a module `V`
|
||||
LL | V::associated_item; //~ ERROR failed to resolve: not a module `V`
|
||||
| ^ not a module `V`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -15,19 +15,19 @@ mod a {
|
|||
extern crate alloc;
|
||||
use alloc::HashMap;
|
||||
//~^ ERROR unresolved import `alloc` [E0432]
|
||||
//~| Did you mean `self::alloc`?
|
||||
//~| did you mean `self::alloc`?
|
||||
mod b {
|
||||
use alloc::HashMap;
|
||||
//~^ ERROR unresolved import `alloc` [E0432]
|
||||
//~| Did you mean `super::alloc`?
|
||||
//~| did you mean `super::alloc`?
|
||||
mod c {
|
||||
use alloc::HashMap;
|
||||
//~^ ERROR unresolved import `alloc` [E0432]
|
||||
//~| Did you mean `std::alloc`?
|
||||
//~| did you mean `a::alloc`?
|
||||
mod d {
|
||||
use alloc::HashMap;
|
||||
//~^ ERROR unresolved import `alloc` [E0432]
|
||||
//~| Did you mean `std::alloc`?
|
||||
//~| did you mean `a::alloc`?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,25 +2,25 @@ error[E0432]: unresolved import `alloc`
|
|||
--> $DIR/resolve_self_super_hint.rs:16:9
|
||||
|
|
||||
LL | use alloc::HashMap;
|
||||
| ^^^^^ Did you mean `self::alloc`?
|
||||
| ^^^^^ did you mean `self::alloc`?
|
||||
|
||||
error[E0432]: unresolved import `alloc`
|
||||
--> $DIR/resolve_self_super_hint.rs:20:13
|
||||
|
|
||||
LL | use alloc::HashMap;
|
||||
| ^^^^^ Did you mean `super::alloc`?
|
||||
| ^^^^^ did you mean `super::alloc`?
|
||||
|
||||
error[E0432]: unresolved import `alloc`
|
||||
--> $DIR/resolve_self_super_hint.rs:24:17
|
||||
|
|
||||
LL | use alloc::HashMap;
|
||||
| ^^^^^ Did you mean `std::alloc`?
|
||||
| ^^^^^ did you mean `a::alloc`?
|
||||
|
||||
error[E0432]: unresolved import `alloc`
|
||||
--> $DIR/resolve_self_super_hint.rs:28:21
|
||||
|
|
||||
LL | use alloc::HashMap;
|
||||
| ^^^^^ Did you mean `std::alloc`?
|
||||
| ^^^^^ did you mean `a::alloc`?
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
error[E0433]: failed to resolve. `crate` in paths can only be used in start position
|
||||
error[E0433]: failed to resolve: `crate` in paths can only be used in start position
|
||||
--> $DIR/crate-path-non-absolute.rs:17:22
|
||||
|
|
||||
LL | let s = ::m::crate::S; //~ ERROR failed to resolve
|
||||
| ^^^^^ `crate` in paths can only be used in start position
|
||||
|
||||
error[E0433]: failed to resolve. global paths cannot start with `crate`
|
||||
error[E0433]: failed to resolve: global paths cannot start with `crate`
|
||||
--> $DIR/crate-path-non-absolute.rs:18:20
|
||||
|
|
||||
LL | let s1 = ::crate::S; //~ ERROR failed to resolve
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0432]: unresolved import `xcrate`
|
|||
--> $DIR/non-existent-1.rs:13:5
|
||||
|
|
||||
LL | use xcrate::S; //~ ERROR unresolved import `xcrate`
|
||||
| ^^^^^^ Could not find `xcrate` in `{{root}}`
|
||||
| ^^^^^^ use of undeclared type or module `xcrate`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@
|
|||
|
||||
fn main() {
|
||||
let s = ::xcrate::S;
|
||||
//~^ ERROR failed to resolve. Could not find `xcrate` in `{{root}}`
|
||||
//~^ ERROR failed to resolve: could not find `xcrate` in `{{root}}`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve. Could not find `xcrate` in `{{root}}`
|
||||
error[E0433]: failed to resolve: could not find `xcrate` in `{{root}}`
|
||||
--> $DIR/non-existent-2.rs:14:15
|
||||
|
|
||||
LL | let s = ::xcrate::S;
|
||||
| ^^^^^^ Could not find `xcrate` in `{{root}}`
|
||||
| ^^^^^^ could not find `xcrate` in `{{root}}`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -10,10 +10,12 @@
|
|||
|
||||
// edition:2018
|
||||
|
||||
#![feature(uniform_paths)]
|
||||
|
||||
// Tests that arbitrary crates (other than `core`, `std` and `meta`)
|
||||
// aren't allowed without `--extern`, even if they're in the sysroot.
|
||||
use alloc; //~ ERROR unresolved import `alloc`
|
||||
use test; //~ ERROR unresolved import `test`
|
||||
use proc_macro; //~ ERROR unresolved import `proc_macro`
|
||||
use test; //~ ERROR cannot import a built-in macro
|
||||
use proc_macro; // OK, imports the built-in `proc_macro` attribute, but not the `proc_macro` crate.
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,15 @@
|
|||
error: cannot import a built-in macro
|
||||
--> $DIR/not-whitelisted.rs:18:5
|
||||
|
|
||||
LL | use test; //~ ERROR cannot import a built-in macro
|
||||
| ^^^^
|
||||
|
||||
error[E0432]: unresolved import `alloc`
|
||||
--> $DIR/not-whitelisted.rs:15:5
|
||||
--> $DIR/not-whitelisted.rs:17:5
|
||||
|
|
||||
LL | use alloc; //~ ERROR unresolved import `alloc`
|
||||
| ^^^^^ no `alloc` external crate
|
||||
|
||||
error[E0432]: unresolved import `test`
|
||||
--> $DIR/not-whitelisted.rs:16:5
|
||||
|
|
||||
LL | use test; //~ ERROR unresolved import `test`
|
||||
| ^^^^ no `test` external crate
|
||||
|
||||
error[E0432]: unresolved import `proc_macro`
|
||||
--> $DIR/not-whitelisted.rs:17:5
|
||||
|
|
||||
LL | use proc_macro; //~ ERROR unresolved import `proc_macro`
|
||||
| ^^^^^^^^^^ no `proc_macro` external crate
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0432`.
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue