Skip to content

Commit

Permalink
Rollup merge of rust-lang#40372 - nagisa:never-drop, r=eddyb
Browse files Browse the repository at this point in the history
Do not bother creating StorageLive for TyNever

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

r? @eddyb
  • Loading branch information
Ariel Ben-Yehuda authored Mar 10, 2017
2 parents 8394360 + 84d1f6a commit f7d8ad1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/librustc_mir/build/expr/as_temp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
1 change: 0 additions & 1 deletion src/test/mir-opt/issue-38669.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ fn main() {
// }
//
// bb2: {
// StorageLive(_6);
// _0 = ();
// StorageDead(_4);
// StorageDead(_1);
Expand Down

0 comments on commit f7d8ad1

Please sign in to comment.