Skip to content

Commit 845d9ff

Browse files
committed
Remove some unsized tuple impls now that we don't support unsizing tuples anymore
1 parent f51c987 commit 845d9ff

File tree

4 files changed

+5
-29
lines changed

4 files changed

+5
-29
lines changed

library/core/src/fmt/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,7 +2867,7 @@ macro_rules! tuple {
28672867
maybe_tuple_doc! {
28682868
$($name)+ @
28692869
#[stable(feature = "rust1", since = "1.0.0")]
2870-
impl<$($name:Debug),+> Debug for ($($name,)+) where last_type!($($name,)+): ?Sized {
2870+
impl<$($name:Debug),+> Debug for ($($name,)+) {
28712871
#[allow(non_snake_case, unused_assignments)]
28722872
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
28732873
let mut builder = f.debug_tuple("");
@@ -2898,11 +2898,6 @@ macro_rules! maybe_tuple_doc {
28982898
};
28992899
}
29002900

2901-
macro_rules! last_type {
2902-
($a:ident,) => { $a };
2903-
($a:ident, $($rest_a:ident,)+) => { last_type!($($rest_a,)+) };
2904-
}
2905-
29062901
tuple! { E, D, C, B, A, Z, Y, X, W, V, U, T, }
29072902

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

library/core/src/hash/mod.rs

Lines changed: 1 addition & 6 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// See core/src/primitive_docs.rs for documentation.
22

33
use crate::cmp::Ordering::{self, *};
4-
use crate::marker::{ConstParamTy_, PointeeSized, StructuralPartialEq, UnsizedConstParamTy};
4+
use crate::marker::{ConstParamTy_, StructuralPartialEq, UnsizedConstParamTy};
55
use crate::ops::ControlFlow::{self, Break, Continue};
66
use crate::random::{Random, RandomSource};
77

@@ -24,10 +24,7 @@ macro_rules! tuple_impls {
2424
maybe_tuple_doc! {
2525
$($T)+ @
2626
#[stable(feature = "rust1", since = "1.0.0")]
27-
impl<$($T: PartialEq),+> PartialEq for ($($T,)+)
28-
where
29-
last_type!($($T,)+): PointeeSized
30-
{
27+
impl<$($T: PartialEq),+> PartialEq for ($($T,)+) {
3128
#[inline]
3229
fn eq(&self, other: &($($T,)+)) -> bool {
3330
$( ${ignore($T)} self.${index()} == other.${index()} )&&+
@@ -43,8 +40,6 @@ macro_rules! tuple_impls {
4340
$($T)+ @
4441
#[stable(feature = "rust1", since = "1.0.0")]
4542
impl<$($T: Eq),+> Eq for ($($T,)+)
46-
where
47-
last_type!($($T,)+): PointeeSized
4843
{}
4944
}
5045

@@ -73,8 +68,6 @@ macro_rules! tuple_impls {
7368
$($T)+ @
7469
#[stable(feature = "rust1", since = "1.0.0")]
7570
impl<$($T: PartialOrd),+> PartialOrd for ($($T,)+)
76-
where
77-
last_type!($($T,)+): PointeeSized
7871
{
7972
#[inline]
8073
fn partial_cmp(&self, other: &($($T,)+)) -> Option<Ordering> {
@@ -119,8 +112,6 @@ macro_rules! tuple_impls {
119112
$($T)+ @
120113
#[stable(feature = "rust1", since = "1.0.0")]
121114
impl<$($T: Ord),+> Ord for ($($T,)+)
122-
where
123-
last_type!($($T,)+): PointeeSized
124115
{
125116
#[inline]
126117
fn cmp(&self, other: &($($T,)+)) -> Ordering {
@@ -245,9 +236,4 @@ macro_rules! lexical_cmp {
245236
($a:expr, $b:expr) => { ($a).cmp(&$b) };
246237
}
247238

248-
macro_rules! last_type {
249-
($a:ident,) => { $a };
250-
($a:ident, $($rest_a:ident,)+) => { last_type!($($rest_a,)+) };
251-
}
252-
253239
tuple_impls!(E D C B A Z Y X W V U T);

0 commit comments

Comments
 (0)