Skip to content

Commit 573c1ff

Browse files
committed
Add a FIXME for mir build unreachable destination checking
1 parent 19ea2d1 commit 573c1ff

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/librustc_mir/build/expr/into.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,14 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
330330
func: fun,
331331
args,
332332
cleanup: Some(cleanup),
333-
destination:
334-
if expr.ty.conservative_is_privately_uninhabited(this.hir.tcx()) {
335-
None
336-
} else {
337-
Some((destination.clone(), success))
338-
},
333+
// FIXME(varkor): replace this with an uninhabitedness-based check.
334+
// This requires getting access to the current module to call
335+
// `tcx.is_ty_uninhabited_from`, which is currently tricky to do.
336+
destination: if expr.ty.is_never() {
337+
None
338+
} else {
339+
Some((destination.clone(), success))
340+
},
339341
from_hir_call,
340342
},
341343
);

0 commit comments

Comments
 (0)