-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Make inline suggestions no longer be the default #127282
base: master
Are you sure you want to change the base?
Make inline suggestions no longer be the default #127282
Conversation
8ef3d49
to
1791206
Compare
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
1791206
to
ba252ed
Compare
I noticed a bunch of mistakes in current suggestions thanks to the new output, but all of those can go on other PRs. |
help: use an inclusive range | ||
| | ||
LL | 'a'...'z' => 1, | ||
| ~~~ |
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.
This clippy suggestions are just plain wrong, right?
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.
It's the old pattern syntax for when MSRV is set to the ancient times
rust/src/tools/clippy/tests/ui/almost_complete_range.rs
Lines 70 to 78 in 2b90614
#[clippy::msrv = "1.25"] | |
fn _under_msrv() { | |
let _ = match 'a' { | |
'a'..'z' => 1, | |
'A'..'Z' => 2, | |
'0'..'9' => 3, | |
_ => 4, | |
}; | |
} |
LL | CustomFutureType.await | ||
| |
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.
Interesting, we're missing an underline here.
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.
Does this happen, because we're replacing the entire line? The clippy suggestion probably doesn't add the .await
, but suggests to remove the CustomFutureType
and add CustomFutureType.await
.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.map(|o| o + 1)` | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
help: try |
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.
Clippyy needs to have better messages for these suggestions
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.
☔ The latest upstream changes (presumably #127326) made this pull request unmergeable. Please resolve the merge conflicts. |
Before ``` error: almost complete ascii range --> tests/ui/almost_complete_range.rs:17:17 | LL | let _ = ('a') ..'z'; | ^^^^^^--^^^ | | | help: use an inclusive range: `..=` | = note: `-D clippy::almost-complete-range` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::almost_complete_range)]` ``` After ``` error: almost complete ascii range --> tests/ui/almost_complete_range.rs:17:17 | LL | let _ = ('a') ..'z'; | ^^^^^^^^^^^ | = note: `-D clippy::almost-complete-range` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::almost_complete_range)]` help: use an inclusive range | LL | let _ = ('a') ..='z'; | ~~~ ```
20bf5b1
to
eb6c593
Compare
HIR ty lowering was modified cc @fmease Some changes occurred in cc @BoxyUwU Some changes occurred in tests/ui/check-cfg cc @Urgau Some changes occurred in tests/ui/sanitizer cc @rust-lang/project-exploit-mitigations, @rcvalle
cc @davidtwco, @compiler-errors, @TaKO8Ki Some changes occurred in match checking cc @Nadrieril |
This PR is too big as is, but the diff helps identify specific suggestions that are currently not-perfect, or flat-out wrong. I'll try to fix those things one at a time in separate PRs, making this PR smaller and smaller over time. |
☔ The latest upstream changes (presumably #127008) made this pull request unmergeable. Please resolve the merge conflicts. |
Make the default suggestions show the full patch output instead of trying to render inline.
Before
After
The inline suggestions output has worse readability than the "verbose" output, and it also (as evidenced in the diff of this PR) tends to hide when the suggestion span is slightly off. Backing off of the inline suggestions will also make it easier to migrate to annotate-snippets, as it will be one fewer special case to handle.