From 186d148b4cd67223fde15b421086e74a95501096 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Tue, 22 Sep 2020 10:21:58 -0700 Subject: [PATCH] Use correct feature gate for unsizing casts --- compiler/rustc_mir/src/transform/check_consts/ops.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/rustc_mir/src/transform/check_consts/ops.rs b/compiler/rustc_mir/src/transform/check_consts/ops.rs index b35c041ef53..e14dcf92b89 100644 --- a/compiler/rustc_mir/src/transform/check_consts/ops.rs +++ b/compiler/rustc_mir/src/transform/check_consts/ops.rs @@ -523,11 +523,7 @@ impl NonConstOp for UnionAccess { pub struct UnsizingCast; impl NonConstOp for UnsizingCast { fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status { - if ccx.const_kind() != hir::ConstContext::ConstFn { - Status::Allowed - } else { - Status::Unstable(sym::const_fn_transmute) - } + mcf_status_in_item(ccx) } fn emit_error(&self, ccx: &ConstCx<'_, '_>, span: Span) {