Skip to content

Fix wrong span for hightlight for duplicated diff lines - #147354

Merged
bors merged 1 commit into
rust-lang:masterfrom
chenyukang:yukang-fix-147070-wrong-highlight-span
Oct 7, 2025
Merged

Fix wrong span for hightlight for duplicated diff lines#147354
bors merged 1 commit into
rust-lang:masterfrom
chenyukang:yukang-fix-147070-wrong-highlight-span

Conversation

@chenyukang

@chenyukangchenyukang commented Oct 4, 2025

Copy link
Copy Markdown
Member

Fixes#147070

From comments: #147070 (comment)
The lightlight row for diff must at least 2.

r? @estebank

@rustbot

Copy link
Copy Markdown
Collaborator

rustc_errors::emitter was changed

cc @Muscraft

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 4, 2025
@chenyukang

Copy link
Copy Markdown
MemberAuthor

current output:
image

@chenyukang

Copy link
Copy Markdown
MemberAuthor

The output for tests/ui/mismatched_types/newlines-in-diagnostic-fix-suggestions-92741.rs is also fixed.

Before:
image

Now:
image

@estebank

Copy link
Copy Markdown
Contributor

r=me after addressing comments

@chenyukang
chenyukangforce-pushed the yukang-fix-147070-wrong-highlight-span branch 4 times, most recently from 83a0258 to 4fcd3c0CompareOctober 7, 2025 02:43
@chenyukang
chenyukangforce-pushed the yukang-fix-147070-wrong-highlight-span branch from 4fcd3c0 to 231c395CompareOctober 7, 2025 02:46
@chenyukang

Copy link
Copy Markdown
MemberAuthor

@bors r=estebank

@bors

bors commented Oct 7, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 231c395 has been approved by estebank

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 7, 2025
bors added a commit that referenced this pull request Oct 7, 2025
Rollup of 7 pull requests
Successful merges:
- #145495 (Use declarative macro for `#[derive(TryFromU32)]`)
- #147165 (test: Subtract code_offset from width for ui_testing)
- #147354 (Fix wrong span for hightlight for duplicated diff lines)
- #147395 (Improve diagnostics: update note and add help message)
- #147396 (Fluent tidy improvements)
- #147407 (Update books)
- #147413 (don't panic on extern with just multiple quotes in the name)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit f64703c into rust-lang:masterOct 7, 2025
10 checks passed
@rustbotrustbot added this to the 1.92.0 milestone Oct 7, 2025
rust-timer added a commit that referenced this pull request Oct 7, 2025
Rollup merge of #147354 - chenyukang:yukang-fix-147070-wrong-highlight-span, r=estebank
Fix wrong span for hightlight for duplicated diff lines
Fixes#147070
From comments: #147070 (comment)
The lightlight row for diff must at least 2.
r? `@estebank`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 7, 2025
…fmease
Print tip for human error format in runtest
When working on rust-lang#147354, spent some time to figure out that there is `//~ ERROR` left on test file, this PR will give a better error message for this scenario.
rust-timer added a commit that referenced this pull request Oct 7, 2025
Rollup merge of #147429 - chenyukang:yukang-fix-test-tip, r=fmease
Print tip for human error format in runtest
When working on #147354, spent some time to figure out that there is `//~ ERROR` left on test file, this PR will give a better error message for this scenario.
github-actionsBot pushed a commit to rust-lang/miri that referenced this pull request Oct 8, 2025
Rollup of 7 pull requests
Successful merges:
- rust-lang/rust#145495 (Use declarative macro for `#[derive(TryFromU32)]`)
- rust-lang/rust#147165 (test: Subtract code_offset from width for ui_testing)
- rust-lang/rust#147354 (Fix wrong span for hightlight for duplicated diff lines)
- rust-lang/rust#147395 (Improve diagnostics: update note and add help message)
- rust-lang/rust#147396 (Fluent tidy improvements)
- rust-lang/rust#147407 (Update books)
- rust-lang/rust#147413 (don't panic on extern with just multiple quotes in the name)
r? `@ghost`
`@rustbot` modify labels: rollup
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Oct 18, 2025
Rollup of 7 pull requests
Successful merges:
- rust-lang/rust#145495 (Use declarative macro for `#[derive(TryFromU32)]`)
- rust-lang/rust#147165 (test: Subtract code_offset from width for ui_testing)
- rust-lang/rust#147354 (Fix wrong span for hightlight for duplicated diff lines)
- rust-lang/rust#147395 (Improve diagnostics: update note and add help message)
- rust-lang/rust#147396 (Fluent tidy improvements)
- rust-lang/rust#147407 (Update books)
- rust-lang/rust#147413 (don't panic on extern with just multiple quotes in the name)
r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Red highlighting in the wrong spot in the "help: remove the extra argument" message

5 participants

@chenyukang@rustbot@estebank@bors@xizheyin