Skip to content

Commit

Permalink
Do not bother creating StorageLive for TyNever
Browse files Browse the repository at this point in the history
Keeps MIR cleaner, `StorageLive(_: !)` makes no sense anyway.
  • Loading branch information
nagisa committed Mar 9, 2017
1 parent ee60afa commit 84d1f6a
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 84d1f6a

Please sign in to comment.