From 573c1ffb78d6b012d565081b8d72a488b7e9bb81 Mon Sep 17 00:00:00 2001 From: varkor Date: Tue, 11 Dec 2018 12:19:16 +0000 Subject: [PATCH] Add a FIXME for mir build unreachable destination checking --- src/librustc_mir/build/expr/into.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/librustc_mir/build/expr/into.rs b/src/librustc_mir/build/expr/into.rs index 8660bbadf3dc2..146bf53830656 100644 --- a/src/librustc_mir/build/expr/into.rs +++ b/src/librustc_mir/build/expr/into.rs @@ -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, }, );