From 9beb6f81e4112eccf9965d46421a1da351b0593a Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Mon, 5 Oct 2020 20:30:32 -0700 Subject: Make `impl Trait` unstable in all contexts --- compiler/rustc_mir/src/transform/check_consts/ops.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_mir/src/transform/check_consts/ops.rs b/compiler/rustc_mir/src/transform/check_consts/ops.rs index e0570ab622e..63b20c7c027 100644 --- a/compiler/rustc_mir/src/transform/check_consts/ops.rs +++ b/compiler/rustc_mir/src/transform/check_consts/ops.rs @@ -558,12 +558,8 @@ pub mod ty { #[derive(Debug)] pub struct ImplTrait; impl NonConstOp for ImplTrait { - fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status { - if ccx.const_kind() != hir::ConstContext::ConstFn { - Status::Allowed - } else { - Status::Unstable(sym::const_impl_trait) - } + fn status_in_item(&self, _: &ConstCx<'_, '_>) -> Status { + Status::Unstable(sym::const_impl_trait) } fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx> { -- cgit 1.4.1-3-g733a5