1
Fork 0

Stabilize const_impl_trait as well

This commit is contained in:
Eric Holk 2022-02-11 18:04:44 -08:00
parent 801be21d11
commit 8700b45b67
9 changed files with 5 additions and 58 deletions

View file

@ -356,7 +356,6 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
match *ty.kind() {
ty::Ref(_, _, hir::Mutability::Mut) => self.check_op(ops::ty::MutRef(kind)),
ty::Opaque(..) => self.check_op(ops::ty::ImplTrait),
_ => {}
}
}

View file

@ -795,25 +795,4 @@ pub mod ty {
)
}
}
#[derive(Debug)]
pub struct ImplTrait;
impl<'tcx> NonConstOp<'tcx> for ImplTrait {
fn status_in_item(&self, _: &ConstCx<'_, '_>) -> Status {
Status::Unstable(sym::const_impl_trait)
}
fn build_error(
&self,
ccx: &ConstCx<'_, 'tcx>,
span: Span,
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
feature_err(
&ccx.tcx.sess.parse_sess,
sym::const_impl_trait,
span,
&format!("`impl Trait` is not allowed in {}s", ccx.const_kind()),
)
}
}
}