significant_drop_tightening
is very slow
#10532
Labels
C-bug
Category: Clippy is not doing the correct thing
significant_drop_tightening
is very slow
#10532
Uh oh!
There was an error while loading. Please reload this page.
Description
significant_drop_tightening
is very slow. I tried running clippy with-Aclippy::all -Wclippy::perf
onrustc_borrowck
. (note that it seemed very slow on the entire compiler, so I don't think there's anything specific toborrowck
, it's just very big.According to a profile, it spends about 66% of time inside
has_sig_drop_attr
:rust-clippy/clippy_lints/src/significant_drop_tightening.rs
Line 307 in 1d1e723
More precisely, it seems to spend the time getting the type of fields.
rust-clippy/clippy_lints/src/significant_drop_tightening.rs
Line 321 in 1d1e723
Inside this function it substitutes the type of the field with the substs (generic parameters) of the type. This folds the type and is a little work. This lint does that little work on everything, turning it into a lot of work. It also does so eagerly recursively which is just a receipe for slowness.
I've got a simple fix, I'll send in a PR.
Version
Additional Labels
@rustbot label +C-bug
The text was updated successfully, but these errors were encountered: