Unify wording of "failed to resolve" errors with "cannot find" resolution errors#128086
Unify wording of "failed to resolve" errors with "cannot find" resolution errors#128086estebank wants to merge 1 commit intorust-lang:masterfrom
Conversation
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
Split off from #126810. "Hide whitespace" will aid in seeing mostly "true" changes. The amount of files being touched is a consequence of the blast radius the diagnostic has. Happy to hear about other potential alternatives for what the output should be instead. |
This comment has been minimized.
This comment has been minimized.
|
Blocking on the wording discussion in #128080 (comment). |
This comment was marked as resolved.
This comment was marked as resolved.
|
Reminder, once the PR becomes ready for a review, use |
2abb31d to
b32d0e7
Compare
This comment has been minimized.
This comment has been minimized.
b32d0e7 to
c397b99
Compare
This comment was marked as resolved.
This comment was marked as resolved.
…tion errors * Use the same wording for all macro resolution errors * specify the scope in which the resolution failure happened Before ``` error[E0433]: failed to resolve: `crate` in paths can only be used in start position --> $DIR/crate-path-non-absolute.rs:5:22 | LL | let s = ::m::crate::S; | ^^^^^ `crate` in paths can only be used in start position ``` after ``` error[E0433]: cannot find module `crate` in module `m` --> $DIR/crate-path-non-absolute.rs:5:22 | LL | let s = ::m::crate::S; | ^^^^^ `crate` in paths can only be used in start position ```
c397b99 to
fa24625
Compare
|
The job Click to see the possible cause of the failure (guessed by this bot) |
| @@ -1,4 +1,4 @@ | |||
| error[E0433]: failed to resolve: use of unresolved module or unlinked crate `r#mod` | |||
| error[E0433]: cannot find item `mod` in this scope | |||
There was a problem hiding this comment.
| error[E0433]: cannot find item `mod` in this scope | |
| error[E0433]: cannot find item `mod` in the crate root |
r#mod in crate::r#mod is not resolved in the current scope.
| @@ -1,4 +1,4 @@ | |||
| error[E0433]: failed to resolve: partially resolved path in a macro | |||
| error[E0433]: cannot find macro `bar` in this scope | |||
There was a problem hiding this comment.
| error[E0433]: cannot find macro `bar` in this scope | |
| error[E0433]: cannot find macro `bar` in enum `Foo` |
| @@ -1,14 +1,14 @@ | |||
| error[E0433]: failed to resolve: partially resolved path in a derive macro | |||
| error[E0433]: cannot find macro `Anything` in this scope | |||
There was a problem hiding this comment.
| error[E0433]: cannot find macro `Anything` in this scope | |
| error[E0433]: cannot find macro `Anything` in trait `Foo` |
| | ^^^^^ there are too many leading `super` keywords | ||
| | ^^^^^ can't use `super` as an identifier | ||
| | | ||
| help: if you still want to call your identifier `super`, use the raw identifier format |
There was a problem hiding this comment.
Path segment keywords (is_path_segment_keyword) like self or super cannot be raw identifiers.
| @@ -1,4 +1,4 @@ | |||
| error[E0433]: failed to resolve: partially resolved path in a macro | |||
| error[E0433]: cannot find macro `Ok` in this scope | |||
There was a problem hiding this comment.
| error[E0433]: cannot find macro `Ok` in this scope | |
| error[E0433]: cannot find macro `Ok` in enum `Result` |
|
|
||
| // tool/extern -> extern | ||
| #[type_ns::inner] //~ ERROR could not find `inner` in `type_ns` | ||
| #[type_ns::inner] //~ ERROR cannot find macro `inner` in crate `macro_helpers` |
There was a problem hiding this comment.
| #[type_ns::inner] //~ ERROR cannot find macro `inner` in crate `macro_helpers` | |
| #[type_ns::inner] //~ ERROR cannot find macro `inner` in crate `type_ns` |
would be preferable, although I'm not sure.
| | ^^^^^^^^ | ||
|
|
||
| error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent` | ||
| error[E0433]: cannot find item `nonexistent` in this scope |
There was a problem hiding this comment.
| error[E0433]: cannot find item `nonexistent` in this scope | |
| error[E0433]: cannot find item `nonexistent` in the crate root |
This is 2015 edition, so imports and visibilities are resolved in the root module.
| @@ -1,4 +1,4 @@ | |||
| error[E0433]: failed to resolve: `String` is a struct, not a module | |||
| error[E0433]: cannot find module `String` in this scope | |||
There was a problem hiding this comment.
| error[E0433]: cannot find module `String` in this scope | |
| error[E0433]: cannot find module `String` in module `string` |
| | | ||
|
|
||
| error[E0433]: failed to resolve: function `bar` is not a crate or module | ||
| error[E0433]: cannot find item `bar` in this scope |
There was a problem hiding this comment.
You can find bar, but it's a function and not a module, the previous error told about that.
| format!( | ||
| "partially resolved path in {} {}", | ||
| kind.article(), | ||
| kind.descr() |
There was a problem hiding this comment.
This could give a more precise description, like "attribute macro" or "derive macro".
|
☔ The latest upstream changes (presumably #142028) made this pull request unmergeable. Please resolve the merge conflicts. |
Before
after
r? @petrochenkov