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

Lifetimes for structs and traits in inlay hints don't work in VSCode #17098

Open
coolCucumber-cat opened this issue Apr 18, 2024 · 4 comments
Open
Labels
A-ide general IDE features A-ty type system / type inference / traits / method resolution C-bug Category: bug E-easy

Comments

@coolCucumber-cat
Copy link

coolCucumber-cat commented Apr 18, 2024

rust-analyzer version: 0.3.1924-standalone (5dbe3fe 2024-04-14)

It also only occurs on this version (0.3.1924) and not previous ones like 0.3.1916

rustc version: rustc 1.77.2 (25ef9e3d8 2024-04-09)

editor or extension: VSCode

code snippet to reproduce:

struct Test<'a> {
	t: &'a i32,
}

fn main() {
	let test = Test { t: &0 };
}

The inlay hint for test is Test<'{error}>. You can also not turn them off. I don't want any lifetimes in inlay hints at all, they take up too much space, so an option to turn them off would be a win-win.

@coolCucumber-cat coolCucumber-cat added the C-bug Category: bug label Apr 18, 2024
@Veykril
Copy link
Member

Veykril commented Apr 18, 2024

Right, we should not show error lifetimes for now as we have too many of them due to missing implementations

@Veykril Veykril added A-ty type system / type inference / traits / method resolution A-ide general IDE features E-easy labels Apr 18, 2024
@coolCucumber-cat
Copy link
Author

@Veykril I'm not sure what you mean? Do you mean lifetime errors instead of error lifetimes?

@Veykril
Copy link
Member

Veykril commented Apr 18, 2024

I'm saying we shouldn't render '{error} in inlay hints currently (or generally), as most lifetimes will end up as errors currently

@Leedehai
Copy link

Adding a Settings option to disable showing lifetime specifiers in the inlay hints ('{error} or otherwise) would be great.

bors added a commit that referenced this issue Apr 25, 2024
internal: Don't render unknown lifetimes when rendering generic args

cc #17098
RalfJung pushed a commit to RalfJung/rust that referenced this issue Apr 26, 2024
internal: Don't render unknown lifetimes when rendering generic args

cc rust-lang/rust-analyzer#17098
RalfJung pushed a commit to RalfJung/rust that referenced this issue Apr 27, 2024
internal: Don't render unknown lifetimes when rendering generic args

cc rust-lang/rust-analyzer#17098
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ide general IDE features A-ty type system / type inference / traits / method resolution C-bug Category: bug E-easy
Projects
None yet
Development

No branches or pull requests

3 participants