Skip to content
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

missing lifetime specifier error ui coloration misaligned #108547

Closed
rol1510 opened this issue Feb 28, 2023 · 0 comments · Fixed by #108627
Closed

missing lifetime specifier error ui coloration misaligned #108547

rol1510 opened this issue Feb 28, 2023 · 0 comments · Fixed by #108627
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-bug Category: This is a bug. D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@rol1510
Copy link
Contributor

rol1510 commented Feb 28, 2023

The bug is in the help section of the "missing lifetime specifier" error (E0106).
When the method head is formatted over multiple lines, then green highlighting will be misaligned.

I tried this code:

fn short(foo_bar: &Vec<&i32>) -> &i32 {
    &12
}

fn long(
    foo_bar: &Vec<&i32>,
    something_very_long_so_that_the_line_will_wrap_around__________: i32,
) -> &i32 {
    &12
}

I expected to see this happen:

For the function short it looks like this, which is fine

image

Instead, this happened:

But for the function long the highlight is misaligned

image

Meta

rustc --version --verbose:

rustc 1.69.0-nightly (d962ea578 2023-02-26)
binary: rustc
commit-hash: d962ea57899d64dc8a57040142c6b498a57c8064
commit-date: 2023-02-26
host: x86_64-pc-windows-msvc
release: 1.69.0-nightly
LLVM version: 15.0.7

also on stable:

rustc 1.67.0 (fc594f156 2023-01-24)
binary: rustc
commit-hash: fc594f15669680fa70d255faec3ca3fb507c3405
commit-date: 2023-01-24
host: x86_64-pc-windows-msvc
release: 1.67.0
LLVM version: 15.0.6
Backtrace

<backtrace>

@rol1510 rol1510 added the C-bug Category: This is a bug. label Feb 28, 2023
@rol1510 rol1510 changed the title missing lifetime specifier error ui coloration missaligned missing lifetime specifier error ui coloration misaligned Feb 28, 2023
@estebank estebank added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` D-papercut Diagnostics: An error or lint that needs small tweaks. labels Mar 1, 2023
@estebank estebank self-assigned this Mar 1, 2023
estebank added a commit to estebank/rust that referenced this issue Mar 1, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 2, 2023
…WaffleLapkin

Properly colorize multi-part suggestions in the same line

Fix rust-lang#108547.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 4, 2023
…WaffleLapkin

Properly colorize multi-part suggestions in the same line

Fix rust-lang#108547.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 4, 2023
…WaffleLapkin

Properly colorize multi-part suggestions in the same line

Fix rust-lang#108547.
@bors bors closed this as completed in 6fd1751 Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-bug Category: This is a bug. D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants