Skip to content

Commit 9beb6f8

Browse files
Make impl Trait unstable in all contexts
1 parent c4ef5fd commit 9beb6f8

File tree

1 file changed

+2
-6
lines changed
  • compiler/rustc_mir/src/transform/check_consts

1 file changed

+2
-6
lines changed

compiler/rustc_mir/src/transform/check_consts/ops.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -558,12 +558,8 @@ pub mod ty {
558558
#[derive(Debug)]
559559
pub struct ImplTrait;
560560
impl NonConstOp for ImplTrait {
561-
fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status {
562-
if ccx.const_kind() != hir::ConstContext::ConstFn {
563-
Status::Allowed
564-
} else {
565-
Status::Unstable(sym::const_impl_trait)
566-
}
561+
fn status_in_item(&self, _: &ConstCx<'_, '_>) -> Status {
562+
Status::Unstable(sym::const_impl_trait)
567563
}
568564

569565
fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx> {

0 commit comments

Comments
 (0)