Remove feature(const_param_ty_trait), use adt_const_params instead

This commit is contained in:
Maybe Waffle 2023-02-22 17:59:49 +00:00
parent c8844e1337
commit 81a2b856c8
3 changed files with 18 additions and 17 deletions

View File

@ -914,36 +914,36 @@ pub trait PointerLike {}
/// A marker for types which can be used as types of `const` generic parameters. /// A marker for types which can be used as types of `const` generic parameters.
#[cfg_attr(not(bootstrap), lang = "const_param_ty")] #[cfg_attr(not(bootstrap), lang = "const_param_ty")]
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
#[rustc_on_unimplemented(message = "`{Self}` can't be used as a const parameter type")] #[rustc_on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
pub trait ConstParamTy: StructuralEq {} pub trait ConstParamTy: StructuralEq {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for usize {} impl ConstParamTy for usize {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for u8 {} impl ConstParamTy for u8 {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for u16 {} impl ConstParamTy for u16 {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for u32 {} impl ConstParamTy for u32 {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for u64 {} impl ConstParamTy for u64 {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for u128 {} impl ConstParamTy for u128 {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for isize {} impl ConstParamTy for isize {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for i8 {} impl ConstParamTy for i8 {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for i16 {} impl ConstParamTy for i16 {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for i32 {} impl ConstParamTy for i32 {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for i64 {} impl ConstParamTy for i64 {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for i128 {} impl ConstParamTy for i128 {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for bool {} impl ConstParamTy for bool {}
#[unstable(feature = "const_param_ty_trait", issue = "none")] #[unstable(feature = "adt_const_params", issue = "95174")]
impl ConstParamTy for char {} impl ConstParamTy for char {}
/// Implementations of `Copy` for primitive types. /// Implementations of `Copy` for primitive types.

View File

@ -1,4 +1,5 @@
#![feature(const_param_ty_trait)] #![allow(incomplete_features)]
#![feature(adt_const_params)]
#[derive(PartialEq, Eq)] #[derive(PartialEq, Eq)]
struct NotParam; struct NotParam;

View File

@ -1,5 +1,5 @@
error[E0204]: the trait `ConstParamTy` may not be implemented for this type error[E0204]: the trait `ConstParamTy` may not be implemented for this type
--> $DIR/const_patam_ty_impl_bad_field.rs:9:36 --> $DIR/const_patam_ty_impl_bad_field.rs:10:36
| |
LL | struct CantParam(NotParam); LL | struct CantParam(NotParam);
| -------- this field does not implement `ConstParamTy` | -------- this field does not implement `ConstParamTy`