Make needs_drop less pessimistic on generators#70015
Merged
bors merged 3 commits intorust-lang:masterfrom Apr 19, 2020
jonas-schievink:gen-needs-drop
Merged
Make needs_drop less pessimistic on generators#70015bors merged 3 commits intorust-lang:masterfrom jonas-schievink:gen-needs-drop
needs_drop less pessimistic on generators#70015bors merged 3 commits intorust-lang:masterfrom
jonas-schievink:gen-needs-drop
Conversation
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.
Generators only have non-trivial drop logic when they may store (in upvars or across yields) a type that does.
This prevents generation of some unnecessary MIR in simple generators. There might be some impact on compile times, but this is probably limited in real-world applications.
This builds off of #69814 since that contains some fixes that are made relevant by this PR (see #69814 (comment)).(this has been merged)