]> git.lizzy.rs Git - rust.git/commitdiff
Make `impl Trait` unstable in all contexts
authorDylan MacKenzie <ecstaticmorse@gmail.com>
Tue, 6 Oct 2020 03:30:32 +0000 (20:30 -0700)
committerDylan MacKenzie <ecstaticmorse@gmail.com>
Tue, 6 Oct 2020 04:44:00 +0000 (21:44 -0700)
compiler/rustc_mir/src/transform/check_consts/ops.rs

index e0570ab622ec16a639bc629aee5626b6501a5fe5..63b20c7c0273dc4bf3137278dde6ccaae0b8a1d7 100644 (file)
@@ -558,12 +558,8 @@ fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<
     #[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> {