Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a FIXME for mir build unreachable destination checking
  • Loading branch information
varkor committed Dec 11, 2018
1 parent 19ea2d1 commit 573c1ff
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/librustc_mir/build/expr/into.rs
Expand Up @@ -330,12 +330,14 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
func: fun,
args,
cleanup: Some(cleanup),
destination:
if expr.ty.conservative_is_privately_uninhabited(this.hir.tcx()) {
None
} else {
Some((destination.clone(), success))
},
// FIXME(varkor): replace this with an uninhabitedness-based check.
// This requires getting access to the current module to call
// `tcx.is_ty_uninhabited_from`, which is currently tricky to do.
destination: if expr.ty.is_never() {
None
} else {
Some((destination.clone(), success))
},
from_hir_call,
},
);
Expand Down

0 comments on commit 573c1ff

Please sign in to comment.