diff options
| author | bors <bors@rust-lang.org> | 2017-07-12 17:04:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-07-12 17:04:14 +0000 |
| commit | f85579d4a2c342654f9b158fafd565eb159fdb59 (patch) | |
| tree | e0ab8d41914e967769ee6422ad434d85c9fbcc31 /src/libcore | |
| parent | b2b19ec92e233b7f91617e4cc2130e70d6e7a5fd (diff) | |
| parent | 388fce9dab429e2cc90588727ae07a4c878bd7b3 (diff) | |
| download | rust-f85579d4a2c342654f9b158fafd565eb159fdb59.tar.gz rust-f85579d4a2c342654f9b158fafd565eb159fdb59.zip | |
Auto merge of #43181 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 8 pull requests - Successful merges: #42670, #42826, #43000, #43011, #43098, #43100, #43136, #43137 - Failed merges:
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/cell.rs | 4 | ||||
| -rw-r--r-- | src/libcore/char.rs | 6 | ||||
| -rw-r--r-- | src/libcore/fmt/mod.rs | 9 | ||||
| -rw-r--r-- | src/libcore/hash/mod.rs | 7 | ||||
| -rw-r--r-- | src/libcore/macros.rs | 2 | ||||
| -rw-r--r-- | src/libcore/tuple.rs | 14 |
6 files changed, 29 insertions, 13 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 1eebf67ad04..35744f3f16b 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -942,7 +942,7 @@ impl<'b, T: ?Sized> Ref<'b, T> { #[unstable(feature = "coerce_unsized", issue = "27732")] impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Ref<'b, U>> for Ref<'b, T> {} -#[stable(feature = "std_guard_impls", since = "1.20")] +#[stable(feature = "std_guard_impls", since = "1.20.0")] impl<'a, T: ?Sized + fmt::Display> fmt::Display for Ref<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.value.fmt(f) @@ -1041,7 +1041,7 @@ impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> { #[unstable(feature = "coerce_unsized", issue = "27732")] impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<RefMut<'b, U>> for RefMut<'b, T> {} -#[stable(feature = "std_guard_impls", since = "1.20")] +#[stable(feature = "std_guard_impls", since = "1.20.0")] impl<'a, T: ?Sized + fmt::Display> fmt::Display for RefMut<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.value.fmt(f) diff --git a/src/libcore/char.rs b/src/libcore/char.rs index 44f5fdbf431..bb4cb0ac3b2 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -210,7 +210,7 @@ impl From<u8> for char { /// An error which can be returned when parsing a char. -#[stable(feature = "char_from_str", since = "1.19.0")] +#[stable(feature = "char_from_str", since = "1.20.0")] #[derive(Clone, Debug)] pub struct ParseCharError { kind: CharErrorKind, @@ -237,7 +237,7 @@ enum CharErrorKind { TooManyChars, } -#[stable(feature = "char_from_str", since = "1.19.0")] +#[stable(feature = "char_from_str", since = "1.20.0")] impl fmt::Display for ParseCharError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.__description().fmt(f) @@ -245,7 +245,7 @@ impl fmt::Display for ParseCharError { } -#[stable(feature = "char_from_str", since = "1.19.0")] +#[stable(feature = "char_from_str", since = "1.20.0")] impl FromStr for char { type Err = ParseCharError; diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index bcc6d53c81d..750e86114c4 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -1627,13 +1627,13 @@ macro_rules! tuple { () => (); ( $($name:ident,)+ ) => ( #[stable(feature = "rust1", since = "1.0.0")] - impl<$($name:Debug),*> Debug for ($($name,)*) { + impl<$($name:Debug),*> Debug for ($($name,)*) where last_type!($($name,)+): ?Sized { #[allow(non_snake_case, unused_assignments, deprecated)] fn fmt(&self, f: &mut Formatter) -> Result { let mut builder = f.debug_tuple(""); let ($(ref $name,)*) = *self; $( - builder.field($name); + builder.field(&$name); )* builder.finish() @@ -1643,6 +1643,11 @@ macro_rules! tuple { ) } +macro_rules! last_type { + ($a:ident,) => { $a }; + ($a:ident, $($rest_a:ident,)+) => { last_type!($($rest_a,)+) }; +} + tuple! { T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, } #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs index 3b304f4c479..2000ba91460 100644 --- a/src/libcore/hash/mod.rs +++ b/src/libcore/hash/mod.rs @@ -559,7 +559,7 @@ mod impls { ( $($name:ident)+) => ( #[stable(feature = "rust1", since = "1.0.0")] - impl<$($name: Hash),*> Hash for ($($name,)*) { + impl<$($name: Hash),*> Hash for ($($name,)*) where last_type!($($name,)+): ?Sized { #[allow(non_snake_case)] fn hash<S: Hasher>(&self, state: &mut S) { let ($(ref $name,)*) = *self; @@ -569,6 +569,11 @@ mod impls { ); } + macro_rules! last_type { + ($a:ident,) => { $a }; + ($a:ident, $($rest_a:ident,)+) => { last_type!($($rest_a,)+) }; + } + impl_hash_tuple! {} impl_hash_tuple! { A } impl_hash_tuple! { A B } diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 70820dce5f9..ae74016ad74 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -462,7 +462,7 @@ macro_rules! writeln { /// /// # Panics /// -/// This will always panic. +/// This will always [panic!](macro.panic.html) /// /// # Examples /// diff --git a/src/libcore/tuple.rs b/src/libcore/tuple.rs index 55d55079ddc..47e9c7c9038 100644 --- a/src/libcore/tuple.rs +++ b/src/libcore/tuple.rs @@ -29,7 +29,7 @@ macro_rules! tuple_impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl<$($T:PartialEq),+> PartialEq for ($($T,)+) { + impl<$($T:PartialEq),+> PartialEq for ($($T,)+) where last_type!($($T,)+): ?Sized { #[inline] fn eq(&self, other: &($($T,)+)) -> bool { $(self.$idx == other.$idx)&&+ @@ -41,10 +41,11 @@ macro_rules! tuple_impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl<$($T:Eq),+> Eq for ($($T,)+) {} + impl<$($T:Eq),+> Eq for ($($T,)+) where last_type!($($T,)+): ?Sized {} #[stable(feature = "rust1", since = "1.0.0")] - impl<$($T:PartialOrd + PartialEq),+> PartialOrd for ($($T,)+) { + impl<$($T:PartialOrd + PartialEq),+> PartialOrd for ($($T,)+) + where last_type!($($T,)+): ?Sized { #[inline] fn partial_cmp(&self, other: &($($T,)+)) -> Option<Ordering> { lexical_partial_cmp!($(self.$idx, other.$idx),+) @@ -68,7 +69,7 @@ macro_rules! tuple_impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl<$($T:Ord),+> Ord for ($($T,)+) { + impl<$($T:Ord),+> Ord for ($($T,)+) where last_type!($($T,)+): ?Sized { #[inline] fn cmp(&self, other: &($($T,)+)) -> Ordering { lexical_cmp!($(self.$idx, other.$idx),+) @@ -118,6 +119,11 @@ 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! { Tuple1 { (0) -> A |
