-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Tweak output of resolve errors #126810
base: master
Are you sure you want to change the base?
Tweak output of resolve errors #126810
Conversation
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
5f349c3
to
b4c34b6
Compare
This comment has been minimized.
This comment has been minimized.
b4c34b6
to
d740595
Compare
This comment was marked as resolved.
This comment was marked as resolved.
d740595
to
57423a7
Compare
@bors r=BoxyUwU rollup=never |
57423a7
to
1e450c7
Compare
Failed to @bors r=BoxyUwU rollup=never |
…xyUwU Remove redundancy in resolve error between main message and primary label ``` error[E0576]: cannot find method or associated constant `BAR` --> $DIR/issue-87638.rs:20:27 | LL | let _ = <S as Trait>::BAR; | ^^^ not found in trait `Trait` ``` instead of ``` error[E0576]: cannot find method or associated constant `BAR` in trait `Trait` --> $DIR/issue-87638.rs:20:27 | LL | let _ = <S as Trait>::BAR; | ^^^ not found in `Trait` ``` The general rule is that the primary span label should work well on its own (suitable to be shown in editors), while the main message provides additional context of the general case. When using `--error-format=short`, we will concatenate the main message and the primary labels, so they should be complementary.
This comment has been minimized.
This comment has been minimized.
Do not mention the scope where an ident couldn't be resolved (particularly for macros), and add a primary span label mentioning "this scope" (ideally we would replace the text with the actual scope name in the future): ``` error: cannot find derive macro `rustfmt` --> $DIR/tool-attributes-misplaced-1.rs:4:10 | LL | #[derive(rustfmt)] | ^^^^^^^ not found in this scope ```
State when the element that couldn't be found was expected to be a module, a generic item, a value or a macro. State what scope the E0433 the item couldn't be found in, when available.
e120581
to
e1fed5f
Compare
☔ The latest upstream changes (presumably #127665) made this pull request unmergeable. Please resolve the merge conflicts. |
Between rust-lang/rust#126810 and rust-lang/rust#126810 the output of `rustc` for resolution errors is going to change in such a way that some existing cargo tests will fail. Change them to support both the current and future output, so that those PRs can land in `rustc`.
"can't use `super` on the crate root, there are no further modules to go \"up\" to" | ||
} else { | ||
"there are too many leading `super` keywords" | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this logic should go into the closure, so it's not executed on a good path (finalize.is_none()
).
This PR is too large
Could you move the single change responsible for the majority of the diff in tests to a separate PR? |
@@ -4,7 +4,7 @@ fn dbl<T>(x: T) -> <T as Add>::Output | |||
where | |||
T: Copy + Add, | |||
UUU: Copy, | |||
//~^ ERROR cannot find type `UUU` in this scope | |||
//~^ ERROR cannot find type `UUU` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, there's actually a lot of unnecessary error annotation changes like this that blow up the PR size.
Could you avoid all of them?
Between rust-lang/rust#126810 and rust-lang/rust#126810 the output of rustc for resolution errors is going to change in such a way that some existing cargo tests will fail. Change them to support both the current and future output, so that those PRs can land in `rustc`.
Between rust-lang/rust#126810 and rust-lang/rust#126810 the output of rustc for resolution errors is going to change in such a way that some existing cargo tests will fail. Change them to support both the current and future output, so that those PRs can land in `rustc`.
Between rust-lang/rust#126810 and rust-lang/rust#126810 the output of rustc for resolution errors is going to change in such a way that some existing cargo tests will fail. Change them to support both the current and future output, so that those PRs can land in `rustc`.
Between rust-lang/rust#126810 and rust-lang/rust#126810 the output of rustc for resolution errors is going to change in such a way that some existing cargo tests will fail. Change them to support both the current and future output, so that those PRs can land in `rustc`.
Between rust-lang/rust#126810 and rust-lang/rust#126810 the output of rustc for resolution errors is going to change in such a way that some existing cargo tests will fail. Change them to support both the current and future output, so that those PRs can land in `rustc`.
Between rust-lang/rust#126810 and rust-lang/rust#126810 the output of rustc for resolution errors is going to change in such a way that some existing cargo tests will fail. Change them to support both the current and future output, so that those PRs can land in `rustc`.
Between rust-lang/rust#126810 and rust-lang/rust#126810 the output of rustc for resolution errors is going to change in such a way that some existing cargo tests will fail. Change them to support both the current and future output, so that those PRs can land in `rustc`.
@estebank |
instead of
The general rule is that the primary span label should work well on its own (suitable to be shown in editors), while the main message provides additional context of the general case. When using
--error-format=short
, we will concatenate the main message and the primary labels, so they should be complementary.