-
Notifications
You must be signed in to change notification settings - Fork 13.7k
fix: Filter suggestion parts that match existing code #146121
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
Conversation
rustbot has assigned @petrochenkov. Use |
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
@bors r+ |
…r=petrochenkov fix: Filter suggestion parts that match existing code While testing my changes to make `rustc` use `annotate-snippets`, I encountered a new `clippy` test failure stemming from [two](https://github.com/rust-lang/rust/pull/145273/files#diff-6e8403e31463539666afbc00479cb416dc767a518f562b6e2960630953ee7da2R275-R278) [suggestion](https://github.com/rust-lang/rust/pull/145273/files#diff-6e8403e31463539666afbc00479cb416dc767a518f562b6e2960630953ee7da2R289-R292) output changes in rust-lang#145273. The new output in these two cases feels like a regression as it is not as clear as the old output, and adds unnecessary information. Before rust-lang#145273 (`Diff` style)  After rust-lang#145273 ("multi-line" style)  The reason for the change was that a new suggestion part (which matches existing code) was added on a different line than the existing parts, causing the suggestion style to change from `Diff` to "multi-line". Since this new part matches existing code, no code changes show up in the output for it, but it still makes the suggestion style "multi-line" when it doesn't need to be. To get the old output back, I made it so that suggestion parts that perfectly match existing code get filtered out.
Rollup of 8 pull requests Successful merges: - #139113 (unstable book: in a sanitizer example, check the code) - #145823 (editorconfig: don't use nonexistent syntax) - #145962 (Ensure we emit an allocator shim when only some crate types need one) - #146032 (Explicity disable LSX feature for `loongarch64-unknown-none` target) - #146090 (Derive `PartialEq` for `InvisibleOrigin`) - #146120 (Correct typo in `rustc_errors` comment) - #146121 (fix: Filter suggestion parts that match existing code) - #146134 (llvm: nvptx: Layout update to match LLVM) r? `@ghost` `@rustbot` modify labels: rollup
…r=petrochenkov fix: Filter suggestion parts that match existing code While testing my changes to make `rustc` use `annotate-snippets`, I encountered a new `clippy` test failure stemming from [two](https://github.com/rust-lang/rust/pull/145273/files#diff-6e8403e31463539666afbc00479cb416dc767a518f562b6e2960630953ee7da2R275-R278) [suggestion](https://github.com/rust-lang/rust/pull/145273/files#diff-6e8403e31463539666afbc00479cb416dc767a518f562b6e2960630953ee7da2R289-R292) output changes in rust-lang#145273. The new output in these two cases feels like a regression as it is not as clear as the old output, and adds unnecessary information. Before rust-lang#145273 (`Diff` style)  After rust-lang#145273 ("multi-line" style)  The reason for the change was that a new suggestion part (which matches existing code) was added on a different line than the existing parts, causing the suggestion style to change from `Diff` to "multi-line". Since this new part matches existing code, no code changes show up in the output for it, but it still makes the suggestion style "multi-line" when it doesn't need to be. To get the old output back, I made it so that suggestion parts that perfectly match existing code get filtered out.
…r=petrochenkov fix: Filter suggestion parts that match existing code While testing my changes to make `rustc` use `annotate-snippets`, I encountered a new `clippy` test failure stemming from [two](https://github.com/rust-lang/rust/pull/145273/files#diff-6e8403e31463539666afbc00479cb416dc767a518f562b6e2960630953ee7da2R275-R278) [suggestion](https://github.com/rust-lang/rust/pull/145273/files#diff-6e8403e31463539666afbc00479cb416dc767a518f562b6e2960630953ee7da2R289-R292) output changes in rust-lang#145273. The new output in these two cases feels like a regression as it is not as clear as the old output, and adds unnecessary information. Before rust-lang#145273 (`Diff` style)  After rust-lang#145273 ("multi-line" style)  The reason for the change was that a new suggestion part (which matches existing code) was added on a different line than the existing parts, causing the suggestion style to change from `Diff` to "multi-line". Since this new part matches existing code, no code changes show up in the output for it, but it still makes the suggestion style "multi-line" when it doesn't need to be. To get the old output back, I made it so that suggestion parts that perfectly match existing code get filtered out.
This probably also fixes (or at least suppresses Could you convert it into a ui test or remove if redundant? @bors r- |
(Let me double-check) @bors try jobs=aarch64-apple |
fix: Filter suggestion parts that match existing code try-job: aarch64-apple
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
f696cd8
to
3f529cf
Compare
This comment has been minimized.
This comment has been minimized.
I have been unable to reproduce the test failure on my Mac locally, so I might have to use @bors try jobs=aarch64-apple |
This comment has been minimized.
This comment has been minimized.
fix: Filter suggestion parts that match existing code try-job: aarch64-apple
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
3f529cf
to
e7fac67
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
e7fac67
to
b307a11
Compare
I spent a ton of time looking into why the ICE was no longer happening on CI, but would still happen locally. Before my change, something causes one of the spans in After thinking about it for a bit, I realized that my changes were only masking the ICE, not fixing the cause of it. To make it so, I was no longer "masking" the ICE; I moved the @rustbot review |
@bors r+ |
…r=petrochenkov fix: Filter suggestion parts that match existing code While testing my changes to make `rustc` use `annotate-snippets`, I encountered a new `clippy` test failure stemming from [two](https://github.com/rust-lang/rust/pull/145273/files#diff-6e8403e31463539666afbc00479cb416dc767a518f562b6e2960630953ee7da2R275-R278) [suggestion](https://github.com/rust-lang/rust/pull/145273/files#diff-6e8403e31463539666afbc00479cb416dc767a518f562b6e2960630953ee7da2R289-R292) output changes in rust-lang#145273. The new output in these two cases feels like a regression as it is not as clear as the old output, and adds unnecessary information. Before rust-lang#145273 (`Diff` style)  After rust-lang#145273 ("multi-line" style)  The reason for the change was that a new suggestion part (which matches existing code) was added on a different line than the existing parts, causing the suggestion style to change from `Diff` to "multi-line". Since this new part matches existing code, no code changes show up in the output for it, but it still makes the suggestion style "multi-line" when it doesn't need to be. To get the old output back, I made it so that suggestion parts that perfectly match existing code get filtered out. try-job: aarch64-apple
Rollup of 4 pull requests Successful merges: - #138944 (Add `__isPlatformVersionAtLeast` and `__isOSVersionAtLeast` symbols) - #146041 (tidy: --bless now makes escheck run with --fix) - #146121 (fix: Filter suggestion parts that match existing code) - #146241 (rustc_infer: change top-level doc comment to inner) r? `@ghost` `@rustbot` modify labels: rollup
☀️ Test successful - checks-actions |
Rollup of 4 pull requests Successful merges: - #138944 (Add `__isPlatformVersionAtLeast` and `__isOSVersionAtLeast` symbols) - #146041 (tidy: --bless now makes escheck run with --fix) - #146121 (fix: Filter suggestion parts that match existing code) - #146241 (rustc_infer: change top-level doc comment to inner) r? `@ghost` `@rustbot` modify labels: rollup
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 9cd272d (parent) -> 99317ef (this PR) Test differencesShow 4 test diffs4 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 99317ef14d0be42fa4039eea7c5ce50cb4e9aee7 --output-dir test-dashboard And then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
Finished benchmarking commit (99317ef): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 1.6%, secondary -2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 466.363s -> 468.222s (0.40%) |
While testing my changes to make
rustc
useannotate-snippets
, I encountered a newclippy
test failure stemming from two suggestion output changes in #145273. The new output in these two cases feels like a regression as it is not as clear as the old output, and adds unnecessary information.Before #145273 (

Diff
style)After #145273 ("multi-line" style)

The reason for the change was that a new suggestion part (which matches existing code) was added on a different line than the existing parts, causing the suggestion style to change from
Diff
to "multi-line". Since this new part matches existing code, no code changes show up in the output for it, but it still makes the suggestion style "multi-line" when it doesn't need to be.To get the old output back, I made it so that suggestion parts that perfectly match existing code get filtered out.
try-job: aarch64-apple