Skip to content

Commit

Permalink
Rollup merge of rust-lang#39383 - nagisa:mir-uninhabited-destinations…
Browse files Browse the repository at this point in the history
…, r=pnkfelix

Remove the workaround for gh32959

This workaround is no longer necessary as Rust, and by extension MIR, now support uninhabited type
properly. This removes the workaround for the gh32959 that was introduced in gh33267.

Fixes rust-lang#32959
  • Loading branch information
GuillaumeGomez authored Feb 2, 2017
2 parents a768827 + d880bbb commit 7bc3222
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/librustc_mir/build/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ use rustc::hir;
impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
pub fn ast_block(&mut self,
destination: &Lvalue<'tcx>,
// FIXME(#32959): temporary measure for the issue
dest_is_unit: bool,
mut block: BasicBlock,
ast_block: &'tcx hir::Block)
-> BlockAnd<()> {
Expand Down Expand Up @@ -83,8 +81,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
// of the block.
if let Some(expr) = expr {
unpack!(block = this.into(destination, block, expr));
} else if dest_is_unit {
// FIXME(#31472)
} else {
let source_info = this.source_info(span);
this.cfg.push_assign_unit(block, source_info, destination);
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/build/expr/into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
this.in_scope(extent, block, |this| this.into(destination, block, value))
}
ExprKind::Block { body: ast_block } => {
this.ast_block(destination, expr.ty.is_nil(), block, ast_block)
this.ast_block(destination, block, ast_block)
}
ExprKind::Match { discriminant, arms } => {
this.match_expr(destination, expr_span, block, discriminant, arms)
Expand Down

0 comments on commit 7bc3222

Please sign in to comment.