Skip to content

Commit 93f64c5

Browse files
committed
Remove some unsized tuple impls now that we don't support unsizing tuples anymore
1 parent 2c6a12e commit 93f64c5

File tree

4 files changed

+4
-28
lines changed

4 files changed

+4
-28
lines changed

library/core/src/fmt/mod.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -2851,7 +2851,7 @@ macro_rules! tuple {
28512851
maybe_tuple_doc! {
28522852
$($name)+ @
28532853
#[stable(feature = "rust1", since = "1.0.0")]
2854-
impl<$($name:Debug),+> Debug for ($($name,)+) where last_type!($($name,)+): ?Sized {
2854+
impl<$($name:Debug),+> Debug for ($($name,)+) {
28552855
#[allow(non_snake_case, unused_assignments)]
28562856
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
28572857
let mut builder = f.debug_tuple("");
@@ -2882,11 +2882,6 @@ macro_rules! maybe_tuple_doc {
28822882
};
28832883
}
28842884

2885-
macro_rules! last_type {
2886-
($a:ident,) => { $a };
2887-
($a:ident, $($rest_a:ident,)+) => { last_type!($($rest_a,)+) };
2888-
}
2889-
28902885
tuple! { E, D, C, B, A, Z, Y, X, W, V, U, T, }
28912886

28922887
#[stable(feature = "rust1", since = "1.0.0")]

library/core/src/hash/mod.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ mod impls {
886886
maybe_tuple_doc! {
887887
$($name)+ @
888888
#[stable(feature = "rust1", since = "1.0.0")]
889-
impl<$($name: Hash),+> Hash for ($($name,)+) where last_type!($($name,)+): ?Sized {
889+
impl<$($name: Hash),+> Hash for ($($name,)+) {
890890
#[allow(non_snake_case)]
891891
#[inline]
892892
fn hash<S: Hasher>(&self, state: &mut S) {
@@ -912,11 +912,6 @@ mod impls {
912912
};
913913
}
914914

915-
macro_rules! last_type {
916-
($a:ident,) => { $a };
917-
($a:ident, $($rest_a:ident,)+) => { last_type!($($rest_a,)+) };
918-
}
919-
920915
impl_hash_tuple! {}
921916
impl_hash_tuple! { T }
922917
impl_hash_tuple! { T B }

library/core/src/ops/range.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ pub enum OneSidedRangeBound {
12111211
/// Types that implement `OneSidedRange<T>` must return `Bound::Unbounded`
12121212
/// from one of `RangeBounds::start_bound` or `RangeBounds::end_bound`.
12131213
#[unstable(feature = "one_sided_range", issue = "69780")]
1214-
pub trait OneSidedRange<T: ?Sized>: RangeBounds<T> {
1214+
pub trait OneSidedRange<T>: RangeBounds<T> {
12151215
/// An internal-only helper function for `split_off` and
12161216
/// `split_off_mut` that returns the bound of the one-sided range.
12171217
fn bound(self) -> (OneSidedRangeBound, T);

library/core/src/tuple.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ macro_rules! tuple_impls {
2222
maybe_tuple_doc! {
2323
$($T)+ @
2424
#[stable(feature = "rust1", since = "1.0.0")]
25-
impl<$($T: PartialEq),+> PartialEq for ($($T,)+)
26-
where
27-
last_type!($($T,)+): ?Sized
28-
{
25+
impl<$($T: PartialEq),+> PartialEq for ($($T,)+) {
2926
#[inline]
3027
fn eq(&self, other: &($($T,)+)) -> bool {
3128
$( ${ignore($T)} self.${index()} == other.${index()} )&&+
@@ -41,8 +38,6 @@ macro_rules! tuple_impls {
4138
$($T)+ @
4239
#[stable(feature = "rust1", since = "1.0.0")]
4340
impl<$($T: Eq),+> Eq for ($($T,)+)
44-
where
45-
last_type!($($T,)+): ?Sized
4641
{}
4742
}
4843

@@ -71,8 +66,6 @@ macro_rules! tuple_impls {
7166
$($T)+ @
7267
#[stable(feature = "rust1", since = "1.0.0")]
7368
impl<$($T: PartialOrd),+> PartialOrd for ($($T,)+)
74-
where
75-
last_type!($($T,)+): ?Sized
7669
{
7770
#[inline]
7871
fn partial_cmp(&self, other: &($($T,)+)) -> Option<Ordering> {
@@ -101,8 +94,6 @@ macro_rules! tuple_impls {
10194
$($T)+ @
10295
#[stable(feature = "rust1", since = "1.0.0")]
10396
impl<$($T: Ord),+> Ord for ($($T,)+)
104-
where
105-
last_type!($($T,)+): ?Sized
10697
{
10798
#[inline]
10899
fn cmp(&self, other: &($($T,)+)) -> Ordering {
@@ -205,9 +196,4 @@ macro_rules! lexical_cmp {
205196
($a:expr, $b:expr) => { ($a).cmp(&$b) };
206197
}
207198

208-
macro_rules! last_type {
209-
($a:ident,) => { $a };
210-
($a:ident, $($rest_a:ident,)+) => { last_type!($($rest_a,)+) };
211-
}
212-
213199
tuple_impls!(E D C B A Z Y X W V U T);

0 commit comments

Comments
 (0)