]> git.lizzy.rs Git - rust.git/commit - src/tools/clippy
Rollup merge of #69814 - jonas-schievink:gen-ret-unw, r=Zoxc
authorMazdak Farrokhzad <twingoow@gmail.com>
Thu, 19 Mar 2020 05:57:32 +0000 (06:57 +0100)
committerGitHub <noreply@github.com>
Thu, 19 Mar 2020 05:57:32 +0000 (06:57 +0100)
commit5570a2374f1b50b1fb85ed247fcec8161eeb2530
tree4fc464ac8c09ee54a3e3c0daf5ece60487743edb
parent61fe2e4036cb8917372e42df66c54596a05d69b7
parent38fa3783ce635814b7e3814ab26d52b653fc0ab0
Rollup merge of #69814 - jonas-schievink:gen-ret-unw, r=Zoxc

Smaller and more correct generator codegen

This removes unnecessary panicking branches in the resume function when the generator can not return or unwind, respectively.

Closes https://github.com/rust-lang/rust/issues/66100

It also addresses the correctness concerns wrt poisoning on unwind. These are not currently a soundness issue because any operation *inside* a generator that could possibly unwind will result in a cleanup path for dropping it, ultimately reaching a `Resume` terminator, which we already handled correctly. Future MIR optimizations might optimize that out, though.

r? @Zoxc
src/librustc_mir/transform/generator.rs