-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error message regression: "no resolution found" #38750
Comments
This is news for me, the change was certainly intended. Now "unresolved"/"resolution" is used twice in non-import paths - in the basic error message ( Alternatives: EDIT: for comparison, errors from clang and gcc:
|
How about something like this? use foo::bar; //~ ERROR no module `foo` in the crate root
// ^^^^^^^^ `foo` undeclared
// ^^^ undeclared (pending better span info)
mod baz {}
use baz::bar; //~ ERROR no item `bar` in `baz`
// ^^^ undeclared
fn main() {
foo; //~ ERROR no value `foo` in scope
// ^^^ not in scope
} |
@jseyfried: I like your examples! |
@petrochenkov I think I feel better with "resolved"/"unresolved" as verbs/adverbs than I do with "resolution" as a noun. I like your other suggestions (and @jseyfried's) better. I would prefer more 'wordy' error messages (similar to the GCC/Clang) examples, rather than the shorter, note-like ones @jseyfried suggested, e.g., " |
To be clear, I was only suggesting the shorter ones for the
|
resolve: Do not use "resolve"/"resolution" in error messages Use less jargon-y wording instead. `cannot find <struct> <S> in <this scope>` and `cannot find <struct> <S> in <module a::b>` are used for base messages (this also harmonizes nicely with "you can import it into scope" suggestions) and `not found in <this scope>` and `not found in <a::b>` are used for short labels in fall-back case. I tweaked some other diagnostics to avoid using "resolve" (see, e.g., `librustc_resolve/macros.rs`), but haven't touched messages for imports. Closes #38750 r? @nrc
"resolution"/"resolve" is compiler jargon and shouldn't be present in user-facing messages. Could be replaced by "declaration" or "definition", though I suspect we might be able to craft a better message than that.
cc @jseyfried @jonathandturner @GuillaumeGomez
The text was updated successfully, but these errors were encountered: