Skip to content

Commit aa97448

Browse files
committed
Auto merge of #59151 - Centril:rollup, r=Centril
Rollup of 16 pull requests Successful merges: - #58829 (librustc_interface: Update scoped-tls to 1.0) - #58876 (Parse lifetimes that start with a number and give specific error) - #58908 (Update rand version) - #58998 (Fix documentation of from_ne_bytes and from_le_bytes) - #59056 (Use lifetime contravariance to elide more lifetimes in core+alloc+std) - #59057 (Standardize `Range*` documentation) - #59080 (Fix incorrect links in librustc_codegen_llvm documentation) - #59083 (Fix #54822 and associated faulty tests) - #59093 (Remove precompute_in_scope_traits_hashes) - #59101 (Reduces Code Repetitions like `!n >> amt`) - #59121 (impl FromIterator for Result: Use assert_eq! instead of assert!) - #59124 (Replace assert with assert_eq) - #59129 (Visit impl Trait for dead_code lint) - #59130 (Note that NonNull does not launder shared references for mutation) - #59132 (ignore higher-ranked object bound conditions created by WF) - #59138 (Simplify Iterator::{min, max}) Failed merges: r? @ghost
2 parents f8860f2 + 73feddb commit aa97448

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+526
-367
lines changed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -2747,7 +2747,7 @@ version = "0.0.0"
27472747
dependencies = [
27482748
"graphviz 0.0.0",
27492749
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
2750-
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
2750+
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
27512751
"rustc 0.0.0",
27522752
"rustc_data_structures 0.0.0",
27532753
"rustc_fs_util 0.0.0",
@@ -2778,7 +2778,7 @@ dependencies = [
27782778
"rustc_resolve 0.0.0",
27792779
"rustc_traits 0.0.0",
27802780
"rustc_typeck 0.0.0",
2781-
"scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
2781+
"scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
27822782
"serialize 0.0.0",
27832783
"smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
27842784
"syntax 0.0.0",

src/liballoc/boxed.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ impl<T: ?Sized> From<Box<T>> for Pin<Box<T>> {
489489
}
490490

491491
#[stable(feature = "box_from_slice", since = "1.17.0")]
492-
impl<'a, T: Copy> From<&'a [T]> for Box<[T]> {
492+
impl<T: Copy> From<&[T]> for Box<[T]> {
493493
/// Converts a `&[T]` into a `Box<[T]>`
494494
///
495495
/// This conversion allocates on the heap
@@ -503,15 +503,15 @@ impl<'a, T: Copy> From<&'a [T]> for Box<[T]> {
503503
///
504504
/// println!("{:?}", boxed_slice);
505505
/// ```
506-
fn from(slice: &'a [T]) -> Box<[T]> {
506+
fn from(slice: &[T]) -> Box<[T]> {
507507
let mut boxed = unsafe { RawVec::with_capacity(slice.len()).into_box() };
508508
boxed.copy_from_slice(slice);
509509
boxed
510510
}
511511
}
512512

513513
#[stable(feature = "box_from_slice", since = "1.17.0")]
514-
impl<'a> From<&'a str> for Box<str> {
514+
impl From<&str> for Box<str> {
515515
/// Converts a `&str` into a `Box<str>`
516516
///
517517
/// This conversion allocates on the heap
@@ -523,7 +523,7 @@ impl<'a> From<&'a str> for Box<str> {
523523
/// println!("{}", boxed);
524524
/// ```
525525
#[inline]
526-
fn from(s: &'a str) -> Box<str> {
526+
fn from(s: &str) -> Box<str> {
527527
unsafe { from_boxed_utf8_unchecked(Box::from(s.as_bytes())) }
528528
}
529529
}

src/liballoc/rc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1145,15 +1145,15 @@ impl<T> From<T> for Rc<T> {
11451145
}
11461146

11471147
#[stable(feature = "shared_from_slice", since = "1.21.0")]
1148-
impl<'a, T: Clone> From<&'a [T]> for Rc<[T]> {
1148+
impl<T: Clone> From<&[T]> for Rc<[T]> {
11491149
#[inline]
11501150
fn from(v: &[T]) -> Rc<[T]> {
11511151
<Self as RcFromSlice<T>>::from_slice(v)
11521152
}
11531153
}
11541154

11551155
#[stable(feature = "shared_from_slice", since = "1.21.0")]
1156-
impl<'a> From<&'a str> for Rc<str> {
1156+
impl From<&str> for Rc<str> {
11571157
#[inline]
11581158
fn from(v: &str) -> Rc<str> {
11591159
let rc = Rc::<[u8]>::from(v.as_bytes());

src/liballoc/string.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2172,9 +2172,9 @@ impl AsRef<[u8]> for String {
21722172
}
21732173

21742174
#[stable(feature = "rust1", since = "1.0.0")]
2175-
impl<'a> From<&'a str> for String {
2175+
impl From<&str> for String {
21762176
#[inline]
2177-
fn from(s: &'a str) -> String {
2177+
fn from(s: &str) -> String {
21782178
s.to_owned()
21792179
}
21802180
}

src/liballoc/vec.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -2182,25 +2182,25 @@ impl<T> AsMut<[T]> for Vec<T> {
21822182
}
21832183

21842184
#[stable(feature = "rust1", since = "1.0.0")]
2185-
impl<'a, T: Clone> From<&'a [T]> for Vec<T> {
2185+
impl<T: Clone> From<&[T]> for Vec<T> {
21862186
#[cfg(not(test))]
2187-
fn from(s: &'a [T]) -> Vec<T> {
2187+
fn from(s: &[T]) -> Vec<T> {
21882188
s.to_vec()
21892189
}
21902190
#[cfg(test)]
2191-
fn from(s: &'a [T]) -> Vec<T> {
2191+
fn from(s: &[T]) -> Vec<T> {
21922192
crate::slice::to_vec(s)
21932193
}
21942194
}
21952195

21962196
#[stable(feature = "vec_from_mut", since = "1.19.0")]
2197-
impl<'a, T: Clone> From<&'a mut [T]> for Vec<T> {
2197+
impl<T: Clone> From<&mut [T]> for Vec<T> {
21982198
#[cfg(not(test))]
2199-
fn from(s: &'a mut [T]) -> Vec<T> {
2199+
fn from(s: &mut [T]) -> Vec<T> {
22002200
s.to_vec()
22012201
}
22022202
#[cfg(test)]
2203-
fn from(s: &'a mut [T]) -> Vec<T> {
2203+
fn from(s: &mut [T]) -> Vec<T> {
22042204
crate::slice::to_vec(s)
22052205
}
22062206
}
@@ -2231,8 +2231,8 @@ impl<T> From<Vec<T>> for Box<[T]> {
22312231
}
22322232

22332233
#[stable(feature = "rust1", since = "1.0.0")]
2234-
impl<'a> From<&'a str> for Vec<u8> {
2235-
fn from(s: &'a str) -> Vec<u8> {
2234+
impl From<&str> for Vec<u8> {
2235+
fn from(s: &str) -> Vec<u8> {
22362236
From::from(s.as_bytes())
22372237
}
22382238
}

src/libcore/array.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ macro_rules! array_impls {
139139
}
140140

141141
#[stable(feature = "try_from", since = "1.34.0")]
142-
impl<'a, T> TryFrom<&'a [T]> for [T; $N] where T: Copy {
142+
impl<T> TryFrom<&[T]> for [T; $N] where T: Copy {
143143
type Error = TryFromSliceError;
144144

145145
fn try_from(slice: &[T]) -> Result<[T; $N], TryFromSliceError> {

src/libcore/benches/iter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn scatter(x: i32) -> i32 { (x * 31) % 127 }
3535
fn bench_max_by_key(b: &mut Bencher) {
3636
b.iter(|| {
3737
let it = 0..100;
38-
it.max_by_key(|&x| scatter(x))
38+
it.map(black_box).max_by_key(|&x| scatter(x))
3939
})
4040
}
4141

@@ -56,7 +56,7 @@ fn bench_max_by_key2(b: &mut Bencher) {
5656
fn bench_max(b: &mut Bencher) {
5757
b.iter(|| {
5858
let it = 0..100;
59-
it.map(scatter).max()
59+
it.map(black_box).map(scatter).max()
6060
})
6161
}
6262

src/libcore/cmp.rs

+24-24
Original file line numberDiff line numberDiff line change
@@ -1004,26 +1004,26 @@ mod impls {
10041004
// & pointers
10051005

10061006
#[stable(feature = "rust1", since = "1.0.0")]
1007-
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b B> for &'a A where A: PartialEq<B> {
1007+
impl<A: ?Sized, B: ?Sized> PartialEq<&B> for &A where A: PartialEq<B> {
10081008
#[inline]
1009-
fn eq(&self, other: & &'b B) -> bool { PartialEq::eq(*self, *other) }
1009+
fn eq(&self, other: & &B) -> bool { PartialEq::eq(*self, *other) }
10101010
#[inline]
1011-
fn ne(&self, other: & &'b B) -> bool { PartialEq::ne(*self, *other) }
1011+
fn ne(&self, other: & &B) -> bool { PartialEq::ne(*self, *other) }
10121012
}
10131013
#[stable(feature = "rust1", since = "1.0.0")]
1014-
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialOrd<&'b B> for &'a A where A: PartialOrd<B> {
1014+
impl<A: ?Sized, B: ?Sized> PartialOrd<&B> for &A where A: PartialOrd<B> {
10151015
#[inline]
1016-
fn partial_cmp(&self, other: &&'b B) -> Option<Ordering> {
1016+
fn partial_cmp(&self, other: &&B) -> Option<Ordering> {
10171017
PartialOrd::partial_cmp(*self, *other)
10181018
}
10191019
#[inline]
1020-
fn lt(&self, other: & &'b B) -> bool { PartialOrd::lt(*self, *other) }
1020+
fn lt(&self, other: & &B) -> bool { PartialOrd::lt(*self, *other) }
10211021
#[inline]
1022-
fn le(&self, other: & &'b B) -> bool { PartialOrd::le(*self, *other) }
1022+
fn le(&self, other: & &B) -> bool { PartialOrd::le(*self, *other) }
10231023
#[inline]
1024-
fn ge(&self, other: & &'b B) -> bool { PartialOrd::ge(*self, *other) }
1024+
fn ge(&self, other: & &B) -> bool { PartialOrd::ge(*self, *other) }
10251025
#[inline]
1026-
fn gt(&self, other: & &'b B) -> bool { PartialOrd::gt(*self, *other) }
1026+
fn gt(&self, other: & &B) -> bool { PartialOrd::gt(*self, *other) }
10271027
}
10281028
#[stable(feature = "rust1", since = "1.0.0")]
10291029
impl<A: ?Sized> Ord for &A where A: Ord {
@@ -1036,26 +1036,26 @@ mod impls {
10361036
// &mut pointers
10371037

10381038
#[stable(feature = "rust1", since = "1.0.0")]
1039-
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a mut A where A: PartialEq<B> {
1039+
impl<A: ?Sized, B: ?Sized> PartialEq<&mut B> for &mut A where A: PartialEq<B> {
10401040
#[inline]
1041-
fn eq(&self, other: &&'b mut B) -> bool { PartialEq::eq(*self, *other) }
1041+
fn eq(&self, other: &&mut B) -> bool { PartialEq::eq(*self, *other) }
10421042
#[inline]
1043-
fn ne(&self, other: &&'b mut B) -> bool { PartialEq::ne(*self, *other) }
1043+
fn ne(&self, other: &&mut B) -> bool { PartialEq::ne(*self, *other) }
10441044
}
10451045
#[stable(feature = "rust1", since = "1.0.0")]
1046-
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialOrd<&'b mut B> for &'a mut A where A: PartialOrd<B> {
1046+
impl<A: ?Sized, B: ?Sized> PartialOrd<&mut B> for &mut A where A: PartialOrd<B> {
10471047
#[inline]
1048-
fn partial_cmp(&self, other: &&'b mut B) -> Option<Ordering> {
1048+
fn partial_cmp(&self, other: &&mut B) -> Option<Ordering> {
10491049
PartialOrd::partial_cmp(*self, *other)
10501050
}
10511051
#[inline]
1052-
fn lt(&self, other: &&'b mut B) -> bool { PartialOrd::lt(*self, *other) }
1052+
fn lt(&self, other: &&mut B) -> bool { PartialOrd::lt(*self, *other) }
10531053
#[inline]
1054-
fn le(&self, other: &&'b mut B) -> bool { PartialOrd::le(*self, *other) }
1054+
fn le(&self, other: &&mut B) -> bool { PartialOrd::le(*self, *other) }
10551055
#[inline]
1056-
fn ge(&self, other: &&'b mut B) -> bool { PartialOrd::ge(*self, *other) }
1056+
fn ge(&self, other: &&mut B) -> bool { PartialOrd::ge(*self, *other) }
10571057
#[inline]
1058-
fn gt(&self, other: &&'b mut B) -> bool { PartialOrd::gt(*self, *other) }
1058+
fn gt(&self, other: &&mut B) -> bool { PartialOrd::gt(*self, *other) }
10591059
}
10601060
#[stable(feature = "rust1", since = "1.0.0")]
10611061
impl<A: ?Sized> Ord for &mut A where A: Ord {
@@ -1066,18 +1066,18 @@ mod impls {
10661066
impl<A: ?Sized> Eq for &mut A where A: Eq {}
10671067

10681068
#[stable(feature = "rust1", since = "1.0.0")]
1069-
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a A where A: PartialEq<B> {
1069+
impl<A: ?Sized, B: ?Sized> PartialEq<&mut B> for &A where A: PartialEq<B> {
10701070
#[inline]
1071-
fn eq(&self, other: &&'b mut B) -> bool { PartialEq::eq(*self, *other) }
1071+
fn eq(&self, other: &&mut B) -> bool { PartialEq::eq(*self, *other) }
10721072
#[inline]
1073-
fn ne(&self, other: &&'b mut B) -> bool { PartialEq::ne(*self, *other) }
1073+
fn ne(&self, other: &&mut B) -> bool { PartialEq::ne(*self, *other) }
10741074
}
10751075

10761076
#[stable(feature = "rust1", since = "1.0.0")]
1077-
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b B> for &'a mut A where A: PartialEq<B> {
1077+
impl<A: ?Sized, B: ?Sized> PartialEq<&B> for &mut A where A: PartialEq<B> {
10781078
#[inline]
1079-
fn eq(&self, other: &&'b B) -> bool { PartialEq::eq(*self, *other) }
1079+
fn eq(&self, other: &&B) -> bool { PartialEq::eq(*self, *other) }
10801080
#[inline]
1081-
fn ne(&self, other: &&'b B) -> bool { PartialEq::ne(*self, *other) }
1081+
fn ne(&self, other: &&B) -> bool { PartialEq::ne(*self, *other) }
10821082
}
10831083
}

src/libcore/internal_macros.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,21 @@ macro_rules! forward_ref_binop {
3737
}
3838

3939
#[$attr]
40-
impl<'a> $imp<&'a $u> for $t {
40+
impl $imp<&$u> for $t {
4141
type Output = <$t as $imp<$u>>::Output;
4242

4343
#[inline]
44-
fn $method(self, other: &'a $u) -> <$t as $imp<$u>>::Output {
44+
fn $method(self, other: &$u) -> <$t as $imp<$u>>::Output {
4545
$imp::$method(self, *other)
4646
}
4747
}
4848

4949
#[$attr]
50-
impl<'a, 'b> $imp<&'a $u> for &'b $t {
50+
impl $imp<&$u> for &$t {
5151
type Output = <$t as $imp<$u>>::Output;
5252

5353
#[inline]
54-
fn $method(self, other: &'a $u) -> <$t as $imp<$u>>::Output {
54+
fn $method(self, other: &$u) -> <$t as $imp<$u>>::Output {
5555
$imp::$method(*self, *other)
5656
}
5757
}
@@ -67,9 +67,9 @@ macro_rules! forward_ref_op_assign {
6767
};
6868
(impl $imp:ident, $method:ident for $t:ty, $u:ty, #[$attr:meta]) => {
6969
#[$attr]
70-
impl<'a> $imp<&'a $u> for $t {
70+
impl $imp<&$u> for $t {
7171
#[inline]
72-
fn $method(&mut self, other: &'a $u) {
72+
fn $method(&mut self, other: &$u) {
7373
$imp::$method(self, *other);
7474
}
7575
}

0 commit comments

Comments
 (0)