Rollup merge of #40372 - nagisa:never-drop, r=eddyb

Do not bother creating StorageLive for TyNever

Keeps MIR cleaner, `StorageLive(_: !)` makes no sense anyway.

r? @eddyb
This commit is contained in:
Ariel Ben-Yehuda 2017-03-11 21:57:45 +02:00 committed by GitHub
commit 66436b5a2a
2 changed files with 1 additions and 2 deletions

View File

@ -55,7 +55,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
(https://github.com/rust-lang/rust/issues/39283)");
}
if temp_lifetime.is_some() {
if !expr_ty.is_never() && temp_lifetime.is_some() {
this.cfg.push(block, Statement {
source_info: source_info,
kind: StatementKind::StorageLive(temp.clone())

View File

@ -35,7 +35,6 @@ fn main() {
// }
//
// bb2: {
// StorageLive(_6);
// _0 = ();
// StorageDead(_4);
// StorageDead(_1);