Skip to content

Make needs_drop less pessimistic on generators#70015

Merged
bors merged 3 commits intorust-lang:masterfrom
jonas-schievink:gen-needs-drop
Apr 19, 2020
Merged

Make needs_drop less pessimistic on generators#70015
bors merged 3 commits intorust-lang:masterfrom
jonas-schievink:gen-needs-drop

Conversation

@jonas-schievink
Copy link
Contributor

@jonas-schievink jonas-schievink commented Mar 15, 2020

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)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants