Skip to content

Commit fce7292

Browse files
committed
Add derive for core::marker::ConstParamTy
This makes it easier to implement it for a type, just like `Copy`.
1 parent a8b5039 commit fce7292

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/src/marker.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,14 @@ pub trait PointerLike {}
991991
#[rustc_on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
992992
pub trait ConstParamTy: StructuralEq {}
993993

994+
/// Derive macro generating an impl of the trait `Copy`.
995+
#[rustc_builtin_macro]
996+
#[unstable(feature = "adt_const_params", issue = "95174")]
997+
#[cfg(not(bootstrap))]
998+
pub macro ConstParamTy($item:item) {
999+
/* compiler built-in */
1000+
}
1001+
9941002
// FIXME(generic_const_parameter_types): handle `ty::FnDef`/`ty::Closure`
9951003
// FIXME(generic_const_parameter_types): handle `ty::Tuple`
9961004
marker_impls! {

0 commit comments

Comments
 (0)