]> git.lizzy.rs Git - rust.git/commit
Auto merge of #64584 - nikomatsakis:issue-64477-generator-capture-types, r=eddyb
authorbors <bors@rust-lang.org>
Fri, 20 Sep 2019 15:35:51 +0000 (15:35 +0000)
committerbors <bors@rust-lang.org>
Fri, 20 Sep 2019 15:35:51 +0000 (15:35 +0000)
commit97e58c0d32bcb8730f8246d25f3d2fa8092b450a
tree91c7f262ca3d830dde50156e752f37b12aafae9c
parent9ad1e7c46cf690b7ec6953b142430d21ca2d8799
parent77fd0a76491afb4c93359f6ceb33a9f79c4f4228
Auto merge of #64584 - nikomatsakis:issue-64477-generator-capture-types, r=eddyb

record fewer adjustment types in generator witnesses, avoid spurious drops in MIR construction

Don't record all intermediate adjustment types -- That's way more than is needed, and winds up recording types that will never appear in MIR.

Note: I'm like 90% sure that this logic is correct, but this stuff is subtle and can be hard to keep straight.  However, the risk of this PR is fairly low -- if we miss types here, I believe the most common outcome is an ICE.

This fixes the original issue cited by #64477, but I'm leaving the issue open for now since there may be other cases we can detect and improve in a targeted way.

r? @Zoxc