fix: Only run Drop::drop when implemented#22582
Open
Veykril wants to merge 1 commit into
Open
Conversation
Veykril
commented
Jun 13, 2026
Comment on lines
+3049
to
+3060
| let (drop_impl, drop_args) = self.db.lookup_impl_method( | ||
| ParamEnvAndCrate { param_env: self.param_env.param_env, krate: self.crate_id }, | ||
| drop_fn, | ||
| generic_args, | ||
| ); | ||
| if let Either::Left(drop_impl) = drop_impl | ||
| && matches!(drop_impl.lookup(self.db).container, ItemContainerId::ImplId(_)) | ||
| && let Ok(body) = self.db.monomorphized_mir_body( | ||
| drop_impl.into(), | ||
| drop_args.store(), | ||
| self.param_env.store(), | ||
| ) |
Member
Author
There was a problem hiding this comment.
Specifically here we now only run drop when its a concrete impl, not sure if we have a better more concise way of checking this tbh
b09dda0 to
9b26191
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Otherwise with the recent
Dropchanges we now get stuck in a recursion as we attempt to dropPin<&mut Self>which itself then runs a destructor forPin<&mut Pin<&mut Self>>` and so on.Was authored with opus 4.8 for investigation.