Reuse machinery from tail_expr_drop_order
for if_let_rescope
#137455
+410
−181
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Namely, it defines its own
extract_component_with_significant_dtor
which is a bit more accurate thanTy::has_significant_drop
, since it has a hard-coded list of types from the ecosystem which are opted out of the lint.1Also, since we extract the dtors themselves, adopt the same label we use in
tail_expr_drop_order
to point out the destructor impl. This makes it much clear what's actually being dropped, so it should be clearer to know when it's a false positive.This conflicts with #137444, but I will rebase whichever lands first.
Footnotes
Side-note, it's kinda a shame that now there are two functions that presumably do the same thing. But this isn't my circus, nor are these my monkeys. ↩