Skip to content

Commit

Permalink
Unrolled build for rust-lang#118350
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#118350 - DaniPopes:tuple-default, r=workingjubilee

Simplify Default for tuples

Doesn't need a separate block for each element
  • Loading branch information
rust-timer authored Dec 6, 2023
2 parents 84a554c + 9ae3213 commit 92581ef
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions library/core/src/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,19 @@ macro_rules! tuple_impls {
maybe_tuple_doc! {
$($T)+ @
#[unstable(feature = "structural_match", issue = "31434")]
impl<$($T: ConstParamTy),+> ConstParamTy for ($($T,)+)
{}
impl<$($T: ConstParamTy),+> ConstParamTy for ($($T,)+) {}
}

maybe_tuple_doc! {
$($T)+ @
#[unstable(feature = "structural_match", issue = "31434")]
impl<$($T),+> StructuralPartialEq for ($($T,)+)
{}
impl<$($T),+> StructuralPartialEq for ($($T,)+) {}
}

maybe_tuple_doc! {
$($T)+ @
#[unstable(feature = "structural_match", issue = "31434")]
impl<$($T),+> StructuralEq for ($($T,)+)
{}
impl<$($T),+> StructuralEq for ($($T,)+) {}
}

maybe_tuple_doc! {
Expand Down Expand Up @@ -118,7 +115,7 @@ macro_rules! tuple_impls {
impl<$($T: Default),+> Default for ($($T,)+) {
#[inline]
fn default() -> ($($T,)+) {
($({ let x: $T = Default::default(); x},)+)
($($T::default(),)+)
}
}
}
Expand Down Expand Up @@ -196,7 +193,7 @@ macro_rules! lexical_partial_cmp {
($a:expr, $b:expr, $($rest_a:expr, $rest_b:expr),+) => {
match ($a).partial_cmp(&$b) {
Some(Equal) => lexical_partial_cmp!($($rest_a, $rest_b),+),
ordering => ordering
ordering => ordering
}
};
($a:expr, $b:expr) => { ($a).partial_cmp(&$b) };
Expand All @@ -206,7 +203,7 @@ macro_rules! lexical_cmp {
($a:expr, $b:expr, $($rest_a:expr, $rest_b:expr),+) => {
match ($a).cmp(&$b) {
Equal => lexical_cmp!($($rest_a, $rest_b),+),
ordering => ordering
ordering => ordering
}
};
($a:expr, $b:expr) => { ($a).cmp(&$b) };
Expand Down

0 comments on commit 92581ef

Please sign in to comment.