-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Rust analyzer false positive error #18133
Comments
I've tried a bit but this seems to be a chalk issue 😢 |
I've bisected this to: rust-analyzer 1.82.0-nightly (0d634185 2024-08-29) -> works |
Oh, that's cool. This might not be a chalk issue then. I'll look into this more. Thanks 😄 |
I use https://github.com/oxalica/rust-overlay - I'm unable to get those same commits as you seemingly: rust-analyzer 1.82.0-nightly (2c93fabd 2024-08-15) (both of these work for me also) |
Bump rust version to latest nightly. - error in core stabilized - min exhaustive patterns stabilized - some new clippy lints - rust-overlay internal changes (we were using some unstable attributes previously) NOTE: Slight change to our custom Debug derive macro due to rust-lang/rust-analyzer#18133
Thanks! |
It seems that nix rust overlay prints versions from its own commit graphs btw |
Bisected to 8a4261a I guess that maybe the chalk is not so happy with the partialy implemented lifetimes in the above commit. For instance, chalk solves this full explicit lifetime modification of the original code well and emits no false-positive diagnostics pub enum Enum<T: Foo> {
String(String),
ImplsBar(T::UsedInEnum),
}
impl<T: Foo> Enum<T> {
pub fn f<'a>(self: &'a Self) {
match *self {
Enum::String(ref string) => dyn_bar(&string),
Enum::ImplsBar(ref a1) => dyn_bar(&a1),
};
}
}
pub trait Foo {
type UsedInEnum: Bar;
type Unused1: Quux;
type Unused2: Quux;
}
pub trait Quux {
type Unused3: Bar;
}
pub trait Bar {}
impl Bar for String {}
impl<'a, T: Bar> Bar for &'a T {}
pub fn dyn_bar<'a>(_: &'a dyn Bar) {} Maybe I should implement lifetime elision inference, which r-a currently doesn't have. |
As @dfireBird is working on lifetime elision, this seems to be resolved once his work is done. If this isn't fixed then, I'll look into this more. |
Likely the same issue as #18064 |
cargo check
works fine, howeverrust-analyzer
errors:Notably both
String
andT::UsedInEnum
error. However! If any of theUnused*
associated types are commented out, it compiles.The text was updated successfully, but these errors were encountered: