-
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
Remove MAX_SUGGESTION_HIGHLIGHT_LINES
#98261
Remove MAX_SUGGESTION_HIGHLIGHT_LINES
#98261
Conversation
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
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.
Great! So removing those extra checks from Clippy seemed to just have worked. Only a small comment.
// we need some newlines | ||
// so that the span is big enough |
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.
Those lines are probably there in order to test that also with more than 6 lines the message is displayed correctly. Can you add those back an re-bless the tests?
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.
That's weird, because I didn't actually change anything here, the original file doesn't have these too:
rust/src/tools/clippy/tests/ui/map_flatten_fixable.rs
Lines 56 to 67 in 10f4ce3
fn issue8878() { | |
std::collections::HashMap::<u32, u32>::new() | |
.get(&0) | |
.map(|_| { | |
// we need some newlines | |
// so that the span is big enough | |
// for a splitted output of the diagnostic | |
Some("") | |
// whitespace beforehand is important as well | |
}) | |
.flatten(); | |
} |
These were removed by x test clippy --bless
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 commit that added this test, rust-lang/rust-clippy@22673bc for some reason has more comments in the .fixed
file, than in the .rs
file.
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.
Oh so this was a bug before, but this PR now fixed that bug. Awesome! Thanks for pointing this out.
📌 Commit ffb593b has been approved by |
…suggestion_highlight_lines, r=flip1995 Remove `MAX_SUGGESTION_HIGHLIGHT_LINES` After rust-lang#97798 the `MAX_SUGGESTION_HIGHLIGHT_LINES` constant doesn't really make sense since we always show full suggestions. This PR removes last usages of the constant and the constant itself. r? `@flip1995` (this mostly does changes in clippy)
Rollup of 9 pull requests Successful merges: - rust-lang#97346 (Remove a back-compat hack on lazy TAIT) - rust-lang#98261 (Remove `MAX_SUGGESTION_HIGHLIGHT_LINES`) - rust-lang#98337 ([RFC 2011] Optimize non-consuming operators) - rust-lang#98384 (Fix RSS reporting on macOS) - rust-lang#98420 (translation: lint fix + more migration) - rust-lang#98430 (Refactor iter adapters with less macros) - rust-lang#98555 (Hermit: Fix initializing lazy locks) - rust-lang#98595 (Implement `Send` and `Sync` for `ThinBox<T>`) - rust-lang#98597 (Remove unstable CStr/CString change from 1.62 release note) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Uncomment test for #8734 I believe the issue was an interaction between rustfix and `span_lint_and_sugg_for_edges`, so this would've been fixed by rust-lang/rust#98261 (Thanks, `@WaffleLapkin!)` Closes #8734 changelog: none
After #97798 the
MAX_SUGGESTION_HIGHLIGHT_LINES
constant doesn't really make sense since we always show full suggestions. This PR removes last usages of the constant and the constant itself.r? @flip1995 (this mostly does changes in clippy)