Clarify message about unresolved use

This commit is contained in:
Kornel 2020-08-27 13:27:14 +01:00
parent 397db054cb
commit 7ec1de062a
52 changed files with 126 additions and 105 deletions

View file

@ -1,17 +1,27 @@
An undeclared type or module was used. An undeclared crate, module, or type was used.
Erroneous code example: Erroneous code example:
```compile_fail,E0433 ```compile_fail,E0433
let map = HashMap::new(); let map = HashMap::new();
// error: failed to resolve: use of undeclared type or module `HashMap` // error: failed to resolve: use of undeclared type `HashMap`
``` ```
Please verify you didn't misspell the type/module's name or that you didn't Please verify you didn't misspell the type/module's name or that you didn't
forget to import it: forget to import it:
``` ```
use std::collections::HashMap; // HashMap has been imported. use std::collections::HashMap; // HashMap has been imported.
let map: HashMap<u32, u32> = HashMap::new(); // So it can be used! let map: HashMap<u32, u32> = HashMap::new(); // So it can be used!
``` ```
If you've expected to use a crate name:
```compile_fail
use ferris_wheel::BigO;
// error: failed to resolve: use of undeclared crate or module `ferris_wheel`
```
Make sure the crate has been added as a dependency in `Cargo.toml`.
To use a module from your current crate, add the `crate::` prefix to the path.

View file

@ -2407,7 +2407,14 @@ impl<'a> Resolver<'a> {
(format!("maybe a missing crate `{}`?", ident), None) (format!("maybe a missing crate `{}`?", ident), None)
} }
} else if i == 0 { } else if i == 0 {
(format!("use of undeclared type or module `{}`", ident), None) if ident
.name
.with(|n| n.chars().next().map_or(false, |c| c.is_ascii_uppercase()))
{
(format!("use of undeclared type `{}`", ident), None)
} else {
(format!("use of undeclared crate or module `{}`", ident), None)
}
} else { } else {
let mut msg = let mut msg =
format!("could not find `{}` in `{}`", ident, path[i - 1].ident); format!("could not find `{}` in `{}`", ident, path[i - 1].ident);

View file

@ -7,7 +7,7 @@
#[no_implicit_prelude] #[no_implicit_prelude]
mod m { mod m {
#[attr] //~ ERROR cannot find attribute `attr` in this scope #[attr] //~ ERROR cannot find attribute `attr` in this scope
#[tool::attr] //~ ERROR failed to resolve: use of undeclared type or module `tool` #[tool::attr] //~ ERROR failed to resolve: use of undeclared crate or module `tool`
fn check() {} fn check() {}
} }

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `tool` error[E0433]: failed to resolve: use of undeclared crate or module `tool`
--> $DIR/register-attr-tool-prelude.rs:10:7 --> $DIR/register-attr-tool-prelude.rs:10:7
| |
LL | #[tool::attr] LL | #[tool::attr]
| ^^^^ use of undeclared type or module `tool` | ^^^^ use of undeclared crate or module `tool`
error: cannot find attribute `attr` in this scope error: cannot find attribute `attr` in this scope
--> $DIR/register-attr-tool-prelude.rs:9:7 --> $DIR/register-attr-tool-prelude.rs:9:7

View file

@ -1,7 +1,7 @@
fn main() { fn main() {
let foo = thing::len(Vec::new()); let foo = thing::len(Vec::new());
//~^ ERROR failed to resolve: use of undeclared type or module `thing` //~^ ERROR failed to resolve: use of undeclared crate or module `thing`
let foo = foo::bar::baz(); let foo = foo::bar::baz();
//~^ ERROR failed to resolve: use of undeclared type or module `foo` //~^ ERROR failed to resolve: use of undeclared crate or module `foo`
} }

View file

@ -1,14 +1,14 @@
error[E0433]: failed to resolve: use of undeclared type or module `thing` error[E0433]: failed to resolve: use of undeclared crate or module `thing`
--> $DIR/bad-module.rs:2:15 --> $DIR/bad-module.rs:2:15
| |
LL | let foo = thing::len(Vec::new()); LL | let foo = thing::len(Vec::new());
| ^^^^^ use of undeclared type or module `thing` | ^^^^^ use of undeclared crate or module `thing`
error[E0433]: failed to resolve: use of undeclared type or module `foo` error[E0433]: failed to resolve: use of undeclared crate or module `foo`
--> $DIR/bad-module.rs:5:15 --> $DIR/bad-module.rs:5:15
| |
LL | let foo = foo::bar::baz(); LL | let foo = foo::bar::baz();
| ^^^ use of undeclared type or module `foo` | ^^^ use of undeclared crate or module `foo`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -1,14 +1,14 @@
error[E0433]: failed to resolve: use of undeclared type or module `nope` error[E0433]: failed to resolve: use of undeclared crate or module `nope`
--> $DIR/conflicting-impl-with-err.rs:4:11 --> $DIR/conflicting-impl-with-err.rs:4:11
| |
LL | impl From<nope::Thing> for Error { LL | impl From<nope::Thing> for Error {
| ^^^^ use of undeclared type or module `nope` | ^^^^ use of undeclared crate or module `nope`
error[E0433]: failed to resolve: use of undeclared type or module `nope` error[E0433]: failed to resolve: use of undeclared crate or module `nope`
--> $DIR/conflicting-impl-with-err.rs:5:16 --> $DIR/conflicting-impl-with-err.rs:5:16
| |
LL | fn from(_: nope::Thing) -> Self { LL | fn from(_: nope::Thing) -> Self {
| ^^^^ use of undeclared type or module `nope` | ^^^^ use of undeclared crate or module `nope`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -1,4 +1,4 @@
error[E0433]: failed to resolve: use of undeclared type or module `HashMap` error[E0433]: failed to resolve: use of undeclared type `HashMap`
--> $DIR/issue-31997-1.rs:20:19 --> $DIR/issue-31997-1.rs:20:19
| |
LL | let mut map = HashMap::new(); LL | let mut map = HashMap::new();

View file

@ -1,7 +1,7 @@
type A0 = dyn; type A0 = dyn;
//~^ ERROR cannot find type `dyn` in this scope //~^ ERROR cannot find type `dyn` in this scope
type A1 = dyn::dyn; type A1 = dyn::dyn;
//~^ ERROR use of undeclared type or module `dyn` //~^ ERROR use of undeclared crate or module `dyn`
type A2 = dyn<dyn, dyn>; type A2 = dyn<dyn, dyn>;
//~^ ERROR cannot find type `dyn` in this scope //~^ ERROR cannot find type `dyn` in this scope
//~| ERROR cannot find type `dyn` in this scope //~| ERROR cannot find type `dyn` in this scope
@ -9,6 +9,6 @@ type A2 = dyn<dyn, dyn>;
type A3 = dyn<<dyn as 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 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 crate or module `dyn`
fn main() {} fn main() {}

View file

@ -1,14 +1,14 @@
error[E0433]: failed to resolve: use of undeclared type or module `dyn` error[E0433]: failed to resolve: use of undeclared crate or module `dyn`
--> $DIR/dyn-trait-compatibility.rs:3:11 --> $DIR/dyn-trait-compatibility.rs:3:11
| |
LL | type A1 = dyn::dyn; LL | type A1 = dyn::dyn;
| ^^^ use of undeclared type or module `dyn` | ^^^ use of undeclared crate or module `dyn`
error[E0433]: failed to resolve: use of undeclared type or module `dyn` error[E0433]: failed to resolve: use of undeclared crate or module `dyn`
--> $DIR/dyn-trait-compatibility.rs:9:23 --> $DIR/dyn-trait-compatibility.rs:9:23
| |
LL | type A3 = dyn<<dyn as dyn>::dyn>; LL | type A3 = dyn<<dyn as dyn>::dyn>;
| ^^^ use of undeclared type or module `dyn` | ^^^ use of undeclared crate or module `dyn`
error[E0412]: cannot find type `dyn` in this scope error[E0412]: cannot find type `dyn` in this scope
--> $DIR/dyn-trait-compatibility.rs:1:11 --> $DIR/dyn-trait-compatibility.rs:1:11

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `NonExistingMap` error[E0433]: failed to resolve: use of undeclared type `NonExistingMap`
--> $DIR/E0433.rs:2:15 --> $DIR/E0433.rs:2:15
| |
LL | let map = NonExistingMap::new(); LL | let map = NonExistingMap::new();
| ^^^^^^^^^^^^^^ use of undeclared type or module `NonExistingMap` | ^^^^^^^^^^^^^^ use of undeclared type `NonExistingMap`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,9 +1,11 @@
// ignore-tidy-linelength
// In this test baz isn't resolved when called as foo.baz even though // In this test baz isn't resolved when called as foo.baz even though
// it's called from inside foo. This is somewhat surprising and may // it's called from inside foo. This is somewhat surprising and may
// want to change eventually. // want to change eventually.
mod foo { 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 crate or module `foo`
fn baz() { } fn baz() { }
} }

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `foo` error[E0433]: failed to resolve: use of undeclared crate or module `foo`
--> $DIR/export-fully-qualified.rs:6:20 --> $DIR/export-fully-qualified.rs:8:20
| |
LL | pub fn bar() { foo::baz(); } LL | pub fn bar() { foo::baz(); }
| ^^^ use of undeclared type or module `foo` | ^^^ use of undeclared crate or module `foo`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,5 +1,5 @@
mod foo { 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 crate or module `bar`
} }
mod bar { mod bar {

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `bar` error[E0433]: failed to resolve: use of undeclared crate or module `bar`
--> $DIR/export2.rs:2:18 --> $DIR/export2.rs:2:18
| |
LL | pub fn x() { bar::x(); } LL | pub fn x() { bar::x(); }
| ^^^ use of undeclared type or module `bar` | ^^^ use of undeclared crate or module `bar`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `somedep` error[E0433]: failed to resolve: use of undeclared crate or module `somedep`
--> $DIR/multiple-opts.rs:19:5 --> $DIR/multiple-opts.rs:19:5
| |
LL | somedep::somefun(); LL | somedep::somefun();
| ^^^^^^^ use of undeclared type or module `somedep` | ^^^^^^^ use of undeclared crate or module `somedep`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `somedep` error[E0433]: failed to resolve: use of undeclared crate or module `somedep`
--> $DIR/noprelude.rs:6:5 --> $DIR/noprelude.rs:6:5
| |
LL | somedep::somefun(); LL | somedep::somefun();
| ^^^^^^^ use of undeclared type or module `somedep` | ^^^^^^^ use of undeclared crate or module `somedep`
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,7 +9,7 @@ macro a() {
mod u { mod u {
// Late resolution. // Late resolution.
fn f() { my_core::mem::drop(0); } fn f() { my_core::mem::drop(0); }
//~^ ERROR failed to resolve: use of undeclared type or module `my_core` //~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
} }
} }
@ -22,7 +22,7 @@ mod v {
mod u { mod u {
// Late resolution. // Late resolution.
fn f() { my_core::mem::drop(0); } fn f() { my_core::mem::drop(0); }
//~^ ERROR failed to resolve: use of undeclared type or module `my_core` //~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
} }
fn main() {} fn main() {}

View file

@ -18,22 +18,22 @@ LL | a!();
| |
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared type or module `my_core` error[E0433]: failed to resolve: use of undeclared crate or module `my_core`
--> $DIR/extern-prelude-from-opaque-fail.rs:11:18 --> $DIR/extern-prelude-from-opaque-fail.rs:11:18
| |
LL | fn f() { my_core::mem::drop(0); } LL | fn f() { my_core::mem::drop(0); }
| ^^^^^^^ use of undeclared type or module `my_core` | ^^^^^^^ use of undeclared crate or module `my_core`
... ...
LL | a!(); LL | a!();
| ----- in this macro invocation | ----- in this macro invocation
| |
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared type or module `my_core` error[E0433]: failed to resolve: use of undeclared crate or module `my_core`
--> $DIR/extern-prelude-from-opaque-fail.rs:24:14 --> $DIR/extern-prelude-from-opaque-fail.rs:24:14
| |
LL | fn f() { my_core::mem::drop(0); } LL | fn f() { my_core::mem::drop(0); }
| ^^^^^^^ use of undeclared type or module `my_core` | ^^^^^^^ use of undeclared crate or module `my_core`
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -6,7 +6,7 @@ LL | assert_eq!(0, 0);
| |
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared type or module `Vec` error[E0433]: failed to resolve: use of undeclared type `Vec`
--> $DIR/no_implicit_prelude.rs:11:9 --> $DIR/no_implicit_prelude.rs:11:9
| |
LL | fn f() { ::bar::m!(); } LL | fn f() { ::bar::m!(); }

View file

@ -1,14 +1,14 @@
error[E0433]: failed to resolve: use of undeclared type or module `foo` error[E0433]: failed to resolve: use of undeclared crate or module `foo`
--> $DIR/issue-72911.rs:12:33 --> $DIR/issue-72911.rs:12:33
| |
LL | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> { LL | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> {
| ^^^ use of undeclared type or module `foo` | ^^^ use of undeclared crate or module `foo`
error[E0433]: failed to resolve: use of undeclared type or module `foo` error[E0433]: failed to resolve: use of undeclared crate or module `foo`
--> $DIR/issue-72911.rs:17:41 --> $DIR/issue-72911.rs:17:41
| |
LL | fn lint_files() -> impl Iterator<Item = foo::MissingItem> { LL | fn lint_files() -> impl Iterator<Item = foo::MissingItem> {
| ^^^ use of undeclared type or module `foo` | ^^^ use of undeclared crate or module `foo`
error[E0720]: cannot resolve opaque type error[E0720]: cannot resolve opaque type
--> $DIR/issue-72911.rs:7:24 --> $DIR/issue-72911.rs:7:24

View file

@ -1,3 +1,5 @@
// ignore-tidy-linelength
// aux-build:two_macros.rs // aux-build:two_macros.rs
// compile-flags:--extern non_existent // compile-flags:--extern non_existent
@ -7,7 +9,7 @@ mod n {
mod m { mod m {
fn check() { 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 crate or module `two_macros`
} }
} }

View file

@ -1,5 +1,5 @@
error: macro-expanded `extern crate` items cannot shadow names passed with `--extern` error: macro-expanded `extern crate` items cannot shadow names passed with `--extern`
--> $DIR/extern-prelude-extern-crate-fail.rs:16:9 --> $DIR/extern-prelude-extern-crate-fail.rs:18:9
| |
LL | extern crate std as non_existent; LL | extern crate std as non_existent;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -9,11 +9,11 @@ LL | define_std_as_non_existent!();
| |
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared type or module `two_macros` error[E0433]: failed to resolve: use of undeclared crate or module `two_macros`
--> $DIR/extern-prelude-extern-crate-fail.rs:10:9 --> $DIR/extern-prelude-extern-crate-fail.rs:12:9
| |
LL | two_macros::m!(); LL | two_macros::m!();
| ^^^^^^^^^^ use of undeclared type or module `two_macros` | ^^^^^^^^^^ use of undeclared crate or module `two_macros`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -1,6 +1,6 @@
fn main() { fn main() {
match 0 { match 0 {
aaa::bbb(_) => () aaa::bbb(_) => ()
//~^ ERROR failed to resolve: use of undeclared type or module `aaa` //~^ ERROR failed to resolve: use of undeclared crate or module `aaa`
}; };
} }

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `aaa` error[E0433]: failed to resolve: use of undeclared crate or module `aaa`
--> $DIR/issue-33293.rs:3:9 --> $DIR/issue-33293.rs:3:9
| |
LL | aaa::bbb(_) => () LL | aaa::bbb(_) => ()
| ^^^ use of undeclared type or module `aaa` | ^^^ use of undeclared crate or module `aaa`
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,7 +2,7 @@
// because macros with the same names are in prelude. // because macros with the same names are in prelude.
fn main() { fn main() {
env::current_dir; //~ ERROR use of undeclared type or module `env` env::current_dir; //~ ERROR use of undeclared crate or module `env`
type A = panic::PanicInfo; //~ ERROR use of undeclared type or module `panic` type A = panic::PanicInfo; //~ ERROR use of undeclared crate or module `panic`
type B = vec::Vec<u8>; //~ ERROR use of undeclared type or module `vec` type B = vec::Vec<u8>; //~ ERROR use of undeclared crate or module `vec`
} }

View file

@ -1,20 +1,20 @@
error[E0433]: failed to resolve: use of undeclared type or module `env` error[E0433]: failed to resolve: use of undeclared crate or module `env`
--> $DIR/builtin-prelude-no-accidents.rs:5:5 --> $DIR/builtin-prelude-no-accidents.rs:5:5
| |
LL | env::current_dir; LL | env::current_dir;
| ^^^ use of undeclared type or module `env` | ^^^ use of undeclared crate or module `env`
error[E0433]: failed to resolve: use of undeclared type or module `panic` error[E0433]: failed to resolve: use of undeclared crate or module `panic`
--> $DIR/builtin-prelude-no-accidents.rs:6:14 --> $DIR/builtin-prelude-no-accidents.rs:6:14
| |
LL | type A = panic::PanicInfo; LL | type A = panic::PanicInfo;
| ^^^^^ use of undeclared type or module `panic` | ^^^^^ use of undeclared crate or module `panic`
error[E0433]: failed to resolve: use of undeclared type or module `vec` error[E0433]: failed to resolve: use of undeclared crate or module `vec`
--> $DIR/builtin-prelude-no-accidents.rs:7:14 --> $DIR/builtin-prelude-no-accidents.rs:7:14
| |
LL | type B = vec::Vec<u8>; LL | type B = vec::Vec<u8>;
| ^^^ use of undeclared type or module `vec` | ^^^ use of undeclared crate or module `vec`
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -15,6 +15,6 @@ test!(b,
#[rustc_dummy] #[rustc_dummy]
fn main() { fn main() {
a::bar(); a::bar();
//~^ ERROR failed to resolve: use of undeclared type or module `a` //~^ ERROR failed to resolve: use of undeclared crate or module `a`
b::bar(); b::bar();
} }

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `a` error[E0433]: failed to resolve: use of undeclared crate or module `a`
--> $DIR/macro-inner-attributes.rs:17:5 --> $DIR/macro-inner-attributes.rs:17:5
| |
LL | a::bar(); LL | a::bar();
| ^ use of undeclared type or module `a` | ^ use of undeclared crate or module `a`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `m` error[E0433]: failed to resolve: use of undeclared crate or module `m`
--> $DIR/macro_path_as_generic_bound.rs:7:6 --> $DIR/macro_path_as_generic_bound.rs:7:6
| |
LL | foo!(m::m2::A); LL | foo!(m::m2::A);
| ^ use of undeclared type or module `m` | ^ use of undeclared crate or module `m`
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,5 +2,5 @@ mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` fou
fn main() { fn main() {
assert_eq!(mod_file_aux::bar(), 10); assert_eq!(mod_file_aux::bar(), 10);
//~^ ERROR failed to resolve: use of undeclared type or module `mod_file_aux` //~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux`
} }

View file

@ -6,11 +6,11 @@ LL | mod mod_file_disambig_aux;
| |
= help: delete or rename one of them to remove the ambiguity = help: delete or rename one of them to remove the ambiguity
error[E0433]: failed to resolve: use of undeclared type or module `mod_file_aux` error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
--> $DIR/mod_file_disambig.rs:4:16 --> $DIR/mod_file_disambig.rs:4:16
| |
LL | assert_eq!(mod_file_aux::bar(), 10); LL | assert_eq!(mod_file_aux::bar(), 10);
| ^^^^^^^^^^^^ use of undeclared type or module `mod_file_aux` | ^^^^^^^^^^^^ use of undeclared crate or module `mod_file_aux`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -5,5 +5,5 @@ mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
fn main() { fn main() {
assert_eq!(mod_file_aux::bar(), 10); assert_eq!(mod_file_aux::bar(), 10);
//~^ ERROR failed to resolve: use of undeclared type or module `mod_file_aux` //~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux`
} }

View file

@ -6,11 +6,11 @@ LL | mod not_a_real_file;
| |
= help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs"
error[E0433]: failed to resolve: use of undeclared type or module `mod_file_aux` error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
--> $DIR/mod_file_not_exist.rs:7:16 --> $DIR/mod_file_not_exist.rs:7:16
| |
LL | assert_eq!(mod_file_aux::bar(), 10); LL | assert_eq!(mod_file_aux::bar(), 10);
| ^^^^^^^^^^^^ use of undeclared type or module `mod_file_aux` | ^^^^^^^^^^^^ use of undeclared crate or module `mod_file_aux`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -5,5 +5,5 @@ mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
fn main() { fn main() {
assert_eq!(mod_file_aux::bar(), 10); assert_eq!(mod_file_aux::bar(), 10);
//~^ ERROR failed to resolve: use of undeclared type or module `mod_file_aux` //~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux`
} }

View file

@ -6,11 +6,11 @@ LL | mod not_a_real_file;
| |
= help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs"
error[E0433]: failed to resolve: use of undeclared type or module `mod_file_aux` error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
--> $DIR/mod_file_not_exist_windows.rs:7:16 --> $DIR/mod_file_not_exist_windows.rs:7:16
| |
LL | assert_eq!(mod_file_aux::bar(), 10); LL | assert_eq!(mod_file_aux::bar(), 10);
| ^^^^^^^^^^^^ use of undeclared type or module `mod_file_aux` | ^^^^^^^^^^^^ use of undeclared crate or module `mod_file_aux`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -30,6 +30,6 @@ fn main() {
//~| expected `char`, found `bool` //~| expected `char`, found `bool`
match () { match () {
E::V => {} //~ ERROR failed to resolve: use of undeclared type or module `E` E::V => {} //~ ERROR failed to resolve: use of undeclared type `E`
} }
} }

View file

@ -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 `E`
--> $DIR/pattern-error-continue.rs:33:9 --> $DIR/pattern-error-continue.rs:33:9
| |
LL | E::V => {} LL | E::V => {}
| ^ use of undeclared type or module `E` | ^ use of undeclared type `E`
error[E0532]: expected tuple struct or tuple variant, found unit variant `A::D` error[E0532]: expected tuple struct or tuple variant, found unit variant `A::D`
--> $DIR/pattern-error-continue.rs:18:9 --> $DIR/pattern-error-continue.rs:18:9

View file

@ -1,10 +1,10 @@
error[E0433]: failed to resolve: use of undeclared type or module `GooMap` error[E0433]: failed to resolve: use of undeclared type `GooMap`
--> $DIR/use_suggestion.rs:3:14 --> $DIR/use_suggestion.rs:3:14
| |
LL | let x2 = GooMap::new(); LL | let x2 = GooMap::new();
| ^^^^^^ use of undeclared type or module `GooMap` | ^^^^^^ use of undeclared type `GooMap`
error[E0433]: failed to resolve: use of undeclared type or module `HashMap` error[E0433]: failed to resolve: use of undeclared type `HashMap`
--> $DIR/use_suggestion.rs:2:14 --> $DIR/use_suggestion.rs:2:14
| |
LL | let x1 = HashMap::new(); LL | let x1 = HashMap::new();

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `xcrate`
--> $DIR/non-existent-1.rs:3:5 --> $DIR/non-existent-1.rs:3:5
| |
LL | use xcrate::S; LL | use xcrate::S;
| ^^^^^^ use of undeclared type or module `xcrate` | ^^^^^^ use of undeclared crate or module `xcrate`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,5 +1,5 @@
fn main() { fn main() {
std:io::stdin(); std:io::stdin();
//~^ ERROR failed to resolve: use of undeclared type or module `io` //~^ ERROR failed to resolve: use of undeclared crate or module `io`
//~| ERROR expected value, found crate //~| ERROR expected value, found crate
} }

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `io` error[E0433]: failed to resolve: use of undeclared crate or module `io`
--> $DIR/type-ascription-instead-of-path.rs:2:9 --> $DIR/type-ascription-instead-of-path.rs:2:9
| |
LL | std:io::stdin(); LL | std:io::stdin();
| ^^ use of undeclared type or module `io` | ^^ use of undeclared crate or module `io`
error[E0423]: expected value, found crate `std` error[E0423]: expected value, found crate `std`
--> $DIR/type-ascription-instead-of-path.rs:2:5 --> $DIR/type-ascription-instead-of-path.rs:2:5

View file

@ -3,6 +3,6 @@ pub trait Trait {
} }
pub type Alias = dyn Trait<A = Self::A>; pub type Alias = dyn Trait<A = Self::A>;
//~^ ERROR failed to resolve: use of undeclared type or module `Self` [E0433] //~^ ERROR failed to resolve: use of undeclared type `Self` [E0433]
fn main() {} fn main() {}

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `Self` error[E0433]: failed to resolve: use of undeclared type `Self`
--> $DIR/issue-62263-self-in-atb.rs:5:32 --> $DIR/issue-62263-self-in-atb.rs:5:32
| |
LL | pub type Alias = dyn Trait<A = Self::A>; LL | pub type Alias = dyn Trait<A = Self::A>;
| ^^^^ use of undeclared type or module `Self` | ^^^^ use of undeclared type `Self`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,4 +1,4 @@
type Alias = Self::Target; type Alias = Self::Target;
//~^ ERROR failed to resolve: use of undeclared type or module `Self` [E0433] //~^ ERROR failed to resolve: use of undeclared type `Self` [E0433]
fn main() {} fn main() {}

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `Self` error[E0433]: failed to resolve: use of undeclared type `Self`
--> $DIR/issue-62305-self-assoc-ty.rs:1:14 --> $DIR/issue-62305-self-assoc-ty.rs:1:14
| |
LL | type Alias = Self::Target; LL | type Alias = Self::Target;
| ^^^^ use of undeclared type or module `Self` | ^^^^ use of undeclared type `Self`
error: aborting due to previous error error: aborting due to previous error

View file

@ -12,7 +12,7 @@ fn ufcs_trait() {
} }
fn ufcs_item() { fn ufcs_item() {
NonExistent::Assoc::<u8>; //~ ERROR undeclared type or module `NonExistent` NonExistent::Assoc::<u8>; //~ ERROR undeclared type `NonExistent`
} }
fn method() { fn method() {

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `NonExistent` error[E0433]: failed to resolve: use of undeclared type `NonExistent`
--> $DIR/type-path-err-node-types.rs:15:5 --> $DIR/type-path-err-node-types.rs:15:5
| |
LL | NonExistent::Assoc::<u8>; LL | NonExistent::Assoc::<u8>;
| ^^^^^^^^^^^ use of undeclared type or module `NonExistent` | ^^^^^^^^^^^ use of undeclared type `NonExistent`
error[E0412]: cannot find type `Nonexistent` in this scope error[E0412]: cannot find type `Nonexistent` in this scope
--> $DIR/type-path-err-node-types.rs:7:12 --> $DIR/type-path-err-node-types.rs:7:12

View file

@ -1,2 +1,2 @@
#[foo::bar] //~ ERROR failed to resolve: use of undeclared type or module `foo` #[foo::bar] //~ ERROR failed to resolve: use of undeclared crate or module `foo`
fn main() {} fn main() {}

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: use of undeclared type or module `foo` error[E0433]: failed to resolve: use of undeclared crate or module `foo`
--> $DIR/unknown-tool-name.rs:1:3 --> $DIR/unknown-tool-name.rs:1:3
| |
LL | #[foo::bar] LL | #[foo::bar]
| ^^^ use of undeclared type or module `foo` | ^^^ use of undeclared crate or module `foo`
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,7 +4,7 @@ impl S {
fn f() {} fn f() {}
fn g() { fn g() {
use Self::f; //~ ERROR unresolved import use Self::f; //~ ERROR unresolved import
pub(in Self::f) struct Z; //~ ERROR use of undeclared type or module `Self` pub(in Self::f) struct Z; //~ ERROR use of undeclared type `Self`
} }
} }

View file

@ -1,14 +1,14 @@
error[E0433]: failed to resolve: use of undeclared type or module `Self` error[E0433]: failed to resolve: use of undeclared type `Self`
--> $DIR/use-self-type.rs:7:16 --> $DIR/use-self-type.rs:7:16
| |
LL | pub(in Self::f) struct Z; LL | pub(in Self::f) struct Z;
| ^^^^ use of undeclared type or module `Self` | ^^^^ use of undeclared type `Self`
error[E0432]: unresolved import `Self` error[E0432]: unresolved import `Self`
--> $DIR/use-self-type.rs:6:13 --> $DIR/use-self-type.rs:6:13
| |
LL | use Self::f; LL | use Self::f;
| ^^^^ use of undeclared type or module `Self` | ^^^^ use of undeclared type `Self`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors