Impl ConstParamTy for tuples, make PartialStructuralEq a supertrait too

This commit is contained in:
Michael Goulet
2023-05-17 03:00:19 +00:00
parent 8ab10bacdf
commit a9fcb524ff
7 changed files with 68 additions and 7 deletions

View File

@@ -1,6 +1,9 @@
// See src/libstd/primitive_docs.rs for documentation.
use crate::cmp::Ordering::{self, *};
#[cfg(not(bootstrap))]
use crate::marker::ConstParamTy;
use crate::marker::{StructuralEq, StructuralPartialEq};
// Recursive macro for implementing n-ary tuple functions and operations
//
@@ -45,6 +48,28 @@ macro_rules! tuple_impls {
{}
}
maybe_tuple_doc! {
$($T)+ @
#[unstable(feature = "structural_match", issue = "31434")]
#[cfg(not(bootstrap))]
impl<$($T: ConstParamTy),+> ConstParamTy for ($($T,)+)
{}
}
maybe_tuple_doc! {
$($T)+ @
#[unstable(feature = "structural_match", issue = "31434")]
impl<$($T),+> StructuralPartialEq for ($($T,)+)
{}
}
maybe_tuple_doc! {
$($T)+ @
#[unstable(feature = "structural_match", issue = "31434")]
impl<$($T),+> StructuralEq for ($($T,)+)
{}
}
maybe_tuple_doc! {
$($T)+ @
#[stable(feature = "rust1", since = "1.0.0")]