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 #32959
This commit is contained in:
Simonas Kazlauskas 2017-01-29 08:17:34 +02:00
parent f39f273826
commit d880bbb35f
2 changed files with 2 additions and 5 deletions

View File

@ -16,8 +16,6 @@ use rustc::hir;
impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
pub fn ast_block(&mut self, pub fn ast_block(&mut self,
destination: &Lvalue<'tcx>, destination: &Lvalue<'tcx>,
// FIXME(#32959): temporary measure for the issue
dest_is_unit: bool,
mut block: BasicBlock, mut block: BasicBlock,
ast_block: &'tcx hir::Block) ast_block: &'tcx hir::Block)
-> BlockAnd<()> { -> BlockAnd<()> {
@ -83,8 +81,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
// of the block. // of the block.
if let Some(expr) = expr { if let Some(expr) = expr {
unpack!(block = this.into(destination, block, expr)); unpack!(block = this.into(destination, block, expr));
} else if dest_is_unit { } else {
// FIXME(#31472)
let source_info = this.source_info(span); let source_info = this.source_info(span);
this.cfg.push_assign_unit(block, source_info, destination); this.cfg.push_assign_unit(block, source_info, destination);
} }

View File

@ -40,7 +40,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
this.in_scope(extent, block, |this| this.into(destination, block, value)) this.in_scope(extent, block, |this| this.into(destination, block, value))
} }
ExprKind::Block { body: ast_block } => { 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 } => { ExprKind::Match { discriminant, arms } => {
this.match_expr(destination, expr_span, block, discriminant, arms) this.match_expr(destination, expr_span, block, discriminant, arms)