Skip to content

missing lifetime specifier error ui coloration misaligned #108547

Closed
@rol1510

Description

@rol1510

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>

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.D-papercutDiagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions