-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarify message about unresolved use
- Loading branch information
Showing
52 changed files
with
126 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
An undeclared type or module was used. | ||
An undeclared crate, module, or type was used. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0433 | ||
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 | ||
forget to import it: | ||
|
||
|
||
``` | ||
use std::collections::HashMap; // HashMap has been imported. | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
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 crate 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 crate or module `foo` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
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 crate or module `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 | ||
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 crate or module `dyn` | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,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 crate or module `aaa` | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.