Open cyypherus opened 1 month ago
Looks like a hang in the significant_drop_tightening lint. Reduced a bit further:
use std::marker::PhantomData;
trait Trait {
type Assoc: Trait;
}
struct S<T: Trait>(*const S<T::Assoc>, PhantomData<T>);
fn f<T: Trait>(x: &mut S<T>) {
&mut x.0;
}
fn main() {}
We keep recursing into the first field of the struct and always miss the type cache because each level of nesting adds another projection (S<T::Assoc>
-> S<T::Assoc::Assoc>
-> S<T::Assoc::Assoc::Assoc>
...).
Sign... There are many errors related to significant_drop_tightening
. I hope to get back to working on it in the coming weeks.
Summary
This code causes clippy to hang & never complete linting.
Reproducer
I tried this code:(See above)
I expected to see this happen: Clippy finish linting within a reasonable time period
Instead, this happened: Clippy doesn't finish linting & hangs, eating 90% cpu
Version
rustc 1.83.0-nightly (1bc403daa 2024-10-11) binary: rustc commit-hash: 1bc403daadbebb553ccc211a0a8eebb73989665f commit-date: 2024-10-11 host: aarch64-apple-darwin release: 1.83.0-nightly LLVM version: 19.1.1
Additional Labels
No response