Open
Description
rust-analyzer version: 0.3.2104-standalone (08c7bbc 2024-09-06)
rustc version: rustc 1.81.0 (eeb90cda1 2024-09-04)
editor or extension: VsCode, with rust-analyzer extension version v0.3.2104
relevant settings:
{
"rust-analyzer.inlayHints.genericParameterHints.lifetime.enable": true,
"rust-analyzer.inlayHints.lifetimeElisionHints.enable": "always",
}
code snippet to reproduce:
pub struct FooRef<'a>(pub &'a i32);
pub struct Foo(i32);
impl Foo {
pub fn foo_as_ref(&self) -> FooRef<'_> {
FooRef(&self.0)
}
}

The elided lifetime for self
and for FooRef
should be shown as the same lifetime in the inlay hint. However, they're shown as different lifetimes.
Discovered by tionway on the rust community discord.