Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 16 pull requests #59151

Merged
merged 44 commits into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
204f087
librustc_interface: Update scoped-tls to 1.0
Xanewok Mar 1, 2019
939a263
Update rand version
JohnTitor Mar 4, 2019
63f60b0
Fix documentation of from_ne_bytes and from_le_bytes
xTibor Mar 7, 2019
0a505a7
Parse lifetimes that start with a number and give specific error
estebank Mar 2, 2019
f690821
review comments
estebank Mar 8, 2019
df4ea90
Use lifetime contravariance to elide more lifetimes in core+alloc+std
scottmcm Mar 10, 2019
d1034c1
Fix incorrect links in librustc_codegen_llvm documentation
nbaksalyar Mar 11, 2019
8b1742e
Fix #54822 and associated faulty tests
kyren Mar 11, 2019
01e2e1f
Remove precompute_in_scope_traits_hashes
Zoxc Mar 10, 2019
749e9d4
added a function for reducing repetition of bit operation
kenta7777 Mar 11, 2019
4c9f7a0
reduced some code repetitions of bit operation
kenta7777 Mar 11, 2019
0ede9e6
replaced some bit operations with truncate
kenta7777 Mar 11, 2019
18b40c6
removed the definition of mask
kenta7777 Mar 11, 2019
95fc3f4
Standardize `Range*` documentation
czipperz Mar 10, 2019
c46f758
Fix RangeBounds documentation to include inclusive operations
czipperz Mar 10, 2019
6b88c90
impl FromIterator for Result: Use assert_eq! instead of assert!
czipperz Mar 12, 2019
365d918
Replace assert with assert_eq for better debugging
ohsayan Mar 12, 2019
2027459
Visit impl Trait for dead_code lint
sanxiyn Mar 12, 2019
7fcdb93
Note that NonNull does not launder shared references for mutation
RalfJung Mar 12, 2019
8ec8639
expand
RalfJung Mar 12, 2019
4632e33
add a useful debug printout
nikomatsakis Mar 12, 2019
261daf2
ignore higher-ranked WF requirements for trait objects
nikomatsakis Mar 12, 2019
8d18e57
Fix the bench_max and bench_max_by_key benchmarks
timvermeulen Mar 12, 2019
b23a047
Remove the projection part of select_fold1
timvermeulen Mar 12, 2019
0de63d9
Fix comment
timvermeulen Mar 12, 2019
1819250
Add tests to ensure that Iterator::min and Iterator::max are stable
timvermeulen Mar 12, 2019
6cc5a3d
Forward `max` and `min` to `max_by` and `min_by` respectively
timvermeulen Mar 12, 2019
aa9bd68
Rename test struct names to something more sensible
kyren Mar 12, 2019
445c4bc
Rollup merge of #58829 - Xanewok:scoped-tls, r=Zoxc
Centril Mar 13, 2019
ad7b650
Rollup merge of #58876 - estebank:numeric-lifetime, r=petrochenkov
Centril Mar 13, 2019
2049d6f
Rollup merge of #58908 - JohnTitor:improve-rand, r=scottmcm
Centril Mar 13, 2019
fc19f0e
Rollup merge of #58998 - xTibor:doc_from_bytes, r=scottmcm
Centril Mar 13, 2019
68abd9a
Rollup merge of #59056 - scottmcm:even-fewer-lifetimes, r=sfackler
Centril Mar 13, 2019
1008150
Rollup merge of #59057 - czipperz:standardize_range_documentation, r=…
Centril Mar 13, 2019
13a8942
Rollup merge of #59080 - nbaksalyar:fix-llvm-codegen-doc, r=frewsxcv
Centril Mar 13, 2019
c0dcfed
Rollup merge of #59083 - kyren:master, r=varkor
Centril Mar 13, 2019
f95bbf3
Rollup merge of #59093 - Zoxc:no-prealloc, r=michaelwoerister
Centril Mar 13, 2019
6c9bdc3
Rollup merge of #59101 - kenta7777:reduce-code-repetition, r=oli-obk
Centril Mar 13, 2019
106159d
Rollup merge of #59121 - czipperz:fix_assert_result_fromiterater, r=C…
Centril Mar 13, 2019
f3dc046
Rollup merge of #59124 - sntdevco:master, r=Centril
Centril Mar 13, 2019
b70a98f
Rollup merge of #59129 - sanxiyn:visit-impl-trait, r=varkor
Centril Mar 13, 2019
3623c1a
Rollup merge of #59130 - RalfJung:non-null, r=rkruppe
Centril Mar 13, 2019
c22566d
Rollup merge of #59132 - nikomatsakis:issue-53548-generator-bound, r=…
Centril Mar 13, 2019
73feddb
Rollup merge of #59138 - timvermeulen:simplify_select_fold1, r=sfackler
Centril Mar 13, 2019
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
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2747,7 +2747,7 @@ version = "0.0.0"
dependencies = [
"graphviz 0.0.0",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_fs_util 0.0.0",
Expand Down Expand Up @@ -2778,7 +2778,7 @@ dependencies = [
"rustc_resolve 0.0.0",
"rustc_traits 0.0.0",
"rustc_typeck 0.0.0",
"scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serialize 0.0.0",
"smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
"syntax 0.0.0",
Expand Down
8 changes: 4 additions & 4 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ impl<T: ?Sized> From<Box<T>> for Pin<Box<T>> {
}

#[stable(feature = "box_from_slice", since = "1.17.0")]
impl<'a, T: Copy> From<&'a [T]> for Box<[T]> {
impl<T: Copy> From<&[T]> for Box<[T]> {
/// Converts a `&[T]` into a `Box<[T]>`
///
/// This conversion allocates on the heap
Expand All @@ -503,15 +503,15 @@ impl<'a, T: Copy> From<&'a [T]> for Box<[T]> {
///
/// println!("{:?}", boxed_slice);
/// ```
fn from(slice: &'a [T]) -> Box<[T]> {
fn from(slice: &[T]) -> Box<[T]> {
let mut boxed = unsafe { RawVec::with_capacity(slice.len()).into_box() };
boxed.copy_from_slice(slice);
boxed
}
}

#[stable(feature = "box_from_slice", since = "1.17.0")]
impl<'a> From<&'a str> for Box<str> {
impl From<&str> for Box<str> {
/// Converts a `&str` into a `Box<str>`
///
/// This conversion allocates on the heap
Expand All @@ -523,7 +523,7 @@ impl<'a> From<&'a str> for Box<str> {
/// println!("{}", boxed);
/// ```
#[inline]
fn from(s: &'a str) -> Box<str> {
fn from(s: &str) -> Box<str> {
unsafe { from_boxed_utf8_unchecked(Box::from(s.as_bytes())) }
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1145,15 +1145,15 @@ impl<T> From<T> for Rc<T> {
}

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

#[stable(feature = "shared_from_slice", since = "1.21.0")]
impl<'a> From<&'a str> for Rc<str> {
impl From<&str> for Rc<str> {
#[inline]
fn from(v: &str) -> Rc<str> {
let rc = Rc::<[u8]>::from(v.as_bytes());
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2172,9 +2172,9 @@ impl AsRef<[u8]> for String {
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a> From<&'a str> for String {
impl From<&str> for String {
#[inline]
fn from(s: &'a str) -> String {
fn from(s: &str) -> String {
s.to_owned()
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2182,25 +2182,25 @@ impl<T> AsMut<[T]> for Vec<T> {
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: Clone> From<&'a [T]> for Vec<T> {
impl<T: Clone> From<&[T]> for Vec<T> {
#[cfg(not(test))]
fn from(s: &'a [T]) -> Vec<T> {
fn from(s: &[T]) -> Vec<T> {
s.to_vec()
}
#[cfg(test)]
fn from(s: &'a [T]) -> Vec<T> {
fn from(s: &[T]) -> Vec<T> {
crate::slice::to_vec(s)
}
}

#[stable(feature = "vec_from_mut", since = "1.19.0")]
impl<'a, T: Clone> From<&'a mut [T]> for Vec<T> {
impl<T: Clone> From<&mut [T]> for Vec<T> {
#[cfg(not(test))]
fn from(s: &'a mut [T]) -> Vec<T> {
fn from(s: &mut [T]) -> Vec<T> {
s.to_vec()
}
#[cfg(test)]
fn from(s: &'a mut [T]) -> Vec<T> {
fn from(s: &mut [T]) -> Vec<T> {
crate::slice::to_vec(s)
}
}
Expand Down Expand Up @@ -2231,8 +2231,8 @@ impl<T> From<Vec<T>> for Box<[T]> {
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a> From<&'a str> for Vec<u8> {
fn from(s: &'a str) -> Vec<u8> {
impl From<&str> for Vec<u8> {
fn from(s: &str) -> Vec<u8> {
From::from(s.as_bytes())
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ macro_rules! array_impls {
}

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

fn try_from(slice: &[T]) -> Result<[T; $N], TryFromSliceError> {
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/benches/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn scatter(x: i32) -> i32 { (x * 31) % 127 }
fn bench_max_by_key(b: &mut Bencher) {
b.iter(|| {
let it = 0..100;
it.max_by_key(|&x| scatter(x))
it.map(black_box).max_by_key(|&x| scatter(x))
})
}

Expand All @@ -56,7 +56,7 @@ fn bench_max_by_key2(b: &mut Bencher) {
fn bench_max(b: &mut Bencher) {
b.iter(|| {
let it = 0..100;
it.map(scatter).max()
it.map(black_box).map(scatter).max()
})
}

Expand Down
48 changes: 24 additions & 24 deletions src/libcore/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1004,26 +1004,26 @@ mod impls {
// & pointers

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b B> for &'a A where A: PartialEq<B> {
impl<A: ?Sized, B: ?Sized> PartialEq<&B> for &A where A: PartialEq<B> {
#[inline]
fn eq(&self, other: & &'b B) -> bool { PartialEq::eq(*self, *other) }
fn eq(&self, other: & &B) -> bool { PartialEq::eq(*self, *other) }
#[inline]
fn ne(&self, other: & &'b B) -> bool { PartialEq::ne(*self, *other) }
fn ne(&self, other: & &B) -> bool { PartialEq::ne(*self, *other) }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialOrd<&'b B> for &'a A where A: PartialOrd<B> {
impl<A: ?Sized, B: ?Sized> PartialOrd<&B> for &A where A: PartialOrd<B> {
#[inline]
fn partial_cmp(&self, other: &&'b B) -> Option<Ordering> {
fn partial_cmp(&self, other: &&B) -> Option<Ordering> {
PartialOrd::partial_cmp(*self, *other)
}
#[inline]
fn lt(&self, other: & &'b B) -> bool { PartialOrd::lt(*self, *other) }
fn lt(&self, other: & &B) -> bool { PartialOrd::lt(*self, *other) }
#[inline]
fn le(&self, other: & &'b B) -> bool { PartialOrd::le(*self, *other) }
fn le(&self, other: & &B) -> bool { PartialOrd::le(*self, *other) }
#[inline]
fn ge(&self, other: & &'b B) -> bool { PartialOrd::ge(*self, *other) }
fn ge(&self, other: & &B) -> bool { PartialOrd::ge(*self, *other) }
#[inline]
fn gt(&self, other: & &'b B) -> bool { PartialOrd::gt(*self, *other) }
fn gt(&self, other: & &B) -> bool { PartialOrd::gt(*self, *other) }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<A: ?Sized> Ord for &A where A: Ord {
Expand All @@ -1036,26 +1036,26 @@ mod impls {
// &mut pointers

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a mut A where A: PartialEq<B> {
impl<A: ?Sized, B: ?Sized> PartialEq<&mut B> for &mut A where A: PartialEq<B> {
#[inline]
fn eq(&self, other: &&'b mut B) -> bool { PartialEq::eq(*self, *other) }
fn eq(&self, other: &&mut B) -> bool { PartialEq::eq(*self, *other) }
#[inline]
fn ne(&self, other: &&'b mut B) -> bool { PartialEq::ne(*self, *other) }
fn ne(&self, other: &&mut B) -> bool { PartialEq::ne(*self, *other) }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialOrd<&'b mut B> for &'a mut A where A: PartialOrd<B> {
impl<A: ?Sized, B: ?Sized> PartialOrd<&mut B> for &mut A where A: PartialOrd<B> {
#[inline]
fn partial_cmp(&self, other: &&'b mut B) -> Option<Ordering> {
fn partial_cmp(&self, other: &&mut B) -> Option<Ordering> {
PartialOrd::partial_cmp(*self, *other)
}
#[inline]
fn lt(&self, other: &&'b mut B) -> bool { PartialOrd::lt(*self, *other) }
fn lt(&self, other: &&mut B) -> bool { PartialOrd::lt(*self, *other) }
#[inline]
fn le(&self, other: &&'b mut B) -> bool { PartialOrd::le(*self, *other) }
fn le(&self, other: &&mut B) -> bool { PartialOrd::le(*self, *other) }
#[inline]
fn ge(&self, other: &&'b mut B) -> bool { PartialOrd::ge(*self, *other) }
fn ge(&self, other: &&mut B) -> bool { PartialOrd::ge(*self, *other) }
#[inline]
fn gt(&self, other: &&'b mut B) -> bool { PartialOrd::gt(*self, *other) }
fn gt(&self, other: &&mut B) -> bool { PartialOrd::gt(*self, *other) }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<A: ?Sized> Ord for &mut A where A: Ord {
Expand All @@ -1066,18 +1066,18 @@ mod impls {
impl<A: ?Sized> Eq for &mut A where A: Eq {}

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

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b B> for &'a mut A where A: PartialEq<B> {
impl<A: ?Sized, B: ?Sized> PartialEq<&B> for &mut A where A: PartialEq<B> {
#[inline]
fn eq(&self, other: &&'b B) -> bool { PartialEq::eq(*self, *other) }
fn eq(&self, other: &&B) -> bool { PartialEq::eq(*self, *other) }
#[inline]
fn ne(&self, other: &&'b B) -> bool { PartialEq::ne(*self, *other) }
fn ne(&self, other: &&B) -> bool { PartialEq::ne(*self, *other) }
}
}
12 changes: 6 additions & 6 deletions src/libcore/internal_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ macro_rules! forward_ref_binop {
}

#[$attr]
impl<'a> $imp<&'a $u> for $t {
impl $imp<&$u> for $t {
type Output = <$t as $imp<$u>>::Output;

#[inline]
fn $method(self, other: &'a $u) -> <$t as $imp<$u>>::Output {
fn $method(self, other: &$u) -> <$t as $imp<$u>>::Output {
$imp::$method(self, *other)
}
}

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

#[inline]
fn $method(self, other: &'a $u) -> <$t as $imp<$u>>::Output {
fn $method(self, other: &$u) -> <$t as $imp<$u>>::Output {
$imp::$method(*self, *other)
}
}
Expand All @@ -67,9 +67,9 @@ macro_rules! forward_ref_op_assign {
};
(impl $imp:ident, $method:ident for $t:ty, $u:ty, #[$attr:meta]) => {
#[$attr]
impl<'a> $imp<&'a $u> for $t {
impl $imp<&$u> for $t {
#[inline]
fn $method(&mut self, other: &'a $u) {
fn $method(&mut self, other: &$u) {
$imp::$method(self, *other);
}
}
Expand Down
Loading