Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions library/core/src/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2867,7 +2867,7 @@ macro_rules! tuple {
maybe_tuple_doc! {
$($name)+ @
#[stable(feature = "rust1", since = "1.0.0")]
impl<$($name:Debug),+> Debug for ($($name,)+) where last_type!($($name,)+): ?Sized {
impl<$($name:Debug),+> Debug for ($($name,)+) {
#[allow(non_snake_case, unused_assignments)]
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
let mut builder = f.debug_tuple("");
Expand Down Expand Up @@ -2898,11 +2898,6 @@ macro_rules! maybe_tuple_doc {
};
}

macro_rules! last_type {
($a:ident,) => { $a };
($a:ident, $($rest_a:ident,)+) => { last_type!($($rest_a,)+) };
}

tuple! { E, D, C, B, A, Z, Y, X, W, V, U, T, }

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
7 changes: 1 addition & 6 deletions library/core/src/hash/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ mod impls {
maybe_tuple_doc! {
$($name)+ @
#[stable(feature = "rust1", since = "1.0.0")]
impl<$($name: Hash),+> Hash for ($($name,)+) where last_type!($($name,)+): ?Sized {
impl<$($name: Hash),+> Hash for ($($name,)+) {
#[allow(non_snake_case)]
#[inline]
fn hash<S: Hasher>(&self, state: &mut S) {
Expand All @@ -912,11 +912,6 @@ mod impls {
};
}

macro_rules! last_type {
($a:ident,) => { $a };
($a:ident, $($rest_a:ident,)+) => { last_type!($($rest_a,)+) };
}

impl_hash_tuple! {}
impl_hash_tuple! { T }
impl_hash_tuple! { T B }
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/ops/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ pub enum OneSidedRangeBound {
/// Types that implement `OneSidedRange<T>` must return `Bound::Unbounded`
/// from one of `RangeBounds::start_bound` or `RangeBounds::end_bound`.
#[unstable(feature = "one_sided_range", issue = "69780")]
pub trait OneSidedRange<T: ?Sized>: RangeBounds<T> {
pub trait OneSidedRange<T>: RangeBounds<T> {
/// An internal-only helper function for `split_off` and
/// `split_off_mut` that returns the bound of the one-sided range.
fn bound(self) -> (OneSidedRangeBound, T);
Expand Down
18 changes: 2 additions & 16 deletions library/core/src/tuple.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// See core/src/primitive_docs.rs for documentation.

use crate::cmp::Ordering::{self, *};
use crate::marker::{ConstParamTy_, PointeeSized, StructuralPartialEq, UnsizedConstParamTy};
use crate::marker::{ConstParamTy_, StructuralPartialEq, UnsizedConstParamTy};
use crate::ops::ControlFlow::{self, Break, Continue};
use crate::random::{Random, RandomSource};

Expand All @@ -24,10 +24,7 @@ macro_rules! tuple_impls {
maybe_tuple_doc! {
$($T)+ @
#[stable(feature = "rust1", since = "1.0.0")]
impl<$($T: PartialEq),+> PartialEq for ($($T,)+)
where
last_type!($($T,)+): PointeeSized
{
impl<$($T: PartialEq),+> PartialEq for ($($T,)+) {
#[inline]
fn eq(&self, other: &($($T,)+)) -> bool {
$( ${ignore($T)} self.${index()} == other.${index()} )&&+
Expand All @@ -43,8 +40,6 @@ macro_rules! tuple_impls {
$($T)+ @
#[stable(feature = "rust1", since = "1.0.0")]
impl<$($T: Eq),+> Eq for ($($T,)+)
where
last_type!($($T,)+): PointeeSized
{}
}

Expand Down Expand Up @@ -73,8 +68,6 @@ macro_rules! tuple_impls {
$($T)+ @
#[stable(feature = "rust1", since = "1.0.0")]
impl<$($T: PartialOrd),+> PartialOrd for ($($T,)+)
where
last_type!($($T,)+): PointeeSized
{
#[inline]
fn partial_cmp(&self, other: &($($T,)+)) -> Option<Ordering> {
Expand Down Expand Up @@ -119,8 +112,6 @@ macro_rules! tuple_impls {
$($T)+ @
#[stable(feature = "rust1", since = "1.0.0")]
impl<$($T: Ord),+> Ord for ($($T,)+)
where
last_type!($($T,)+): PointeeSized
{
#[inline]
fn cmp(&self, other: &($($T,)+)) -> Ordering {
Expand Down Expand Up @@ -245,9 +236,4 @@ macro_rules! lexical_cmp {
($a:expr, $b:expr) => { ($a).cmp(&$b) };
}

macro_rules! last_type {
($a:ident,) => { $a };
($a:ident, $($rest_a:ident,)+) => { last_type!($($rest_a,)+) };
}

tuple_impls!(E D C B A Z Y X W V U T);
Loading