Skip to content

Commit bff5292

Browse files
committed
Auto merge of #30975 - Manishearth:rollup, r=Manishearth
- Successful merges: #30938, #30940, #30943, #30949, #30952, #30957, #30959 - Failed merges:
2 parents 0b524ed + 00a4eea commit bff5292

File tree

68 files changed

+417
-250
lines changed

Some content is hidden

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

68 files changed

+417
-250
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ build.
7878
Download [MinGW from
7979
here](http://mingw-w64.org/doku.php/download/mingw-builds), and choose the
8080
`threads=win32,exceptions=dwarf/seh` flavor when installing. After installing,
81-
add its `bin` directory to your `PATH`. This is due to #28260, in the future,
81+
add its `bin` directory to your `PATH`. This is due to [#28260](https://github.com/rust-lang/rust/issues/28260), in the future,
8282
installing from pacman should be just fine.
8383
8484
```

src/doc/nomicon/vec-final.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ impl<T> Iterator for RawValIter<T> {
226226
} else {
227227
unsafe {
228228
let result = ptr::read(self.start);
229-
self.start = self.start.offset(1);
229+
self.start = if mem::size_of::<T>() == 0 {
230+
(self.start as usize + 1) as *const _
231+
} else {
232+
self.start.offset(1)
233+
};
230234
Some(result)
231235
}
232236
}
@@ -246,7 +250,11 @@ impl<T> DoubleEndedIterator for RawValIter<T> {
246250
None
247251
} else {
248252
unsafe {
249-
self.end = self.end.offset(-1);
253+
self.end = if mem::size_of::<T>() == 0 {
254+
(self.end as usize - 1) as *const _
255+
} else {
256+
self.end.offset(-1)
257+
};
250258
Some(ptr::read(self.end))
251259
}
252260
}

src/doc/nomicon/vec-zsts.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ impl<T> Iterator for RawValIter<T> {
140140
self.start = if mem::size_of::<T>() == 0 {
141141
(self.start as usize + 1) as *const _
142142
} else {
143-
self.start.offset(1);
144-
}
143+
self.start.offset(1)
144+
};
145145
Some(result)
146146
}
147147
}
@@ -164,8 +164,8 @@ impl<T> DoubleEndedIterator for RawValIter<T> {
164164
self.end = if mem::size_of::<T>() == 0 {
165165
(self.end as usize - 1) as *const _
166166
} else {
167-
self.end.offset(-1);
168-
}
167+
self.end.offset(-1)
168+
};
169169
Some(ptr::read(self.end))
170170
}
171171
}

src/liballoc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
#![feature(custom_attribute)]
7979
#![feature(fundamental)]
8080
#![feature(lang_items)]
81-
#![feature(num_bits_bytes)]
8281
#![feature(optin_builtin_traits)]
8382
#![feature(placement_in_syntax)]
8483
#![feature(placement_new_protocol)]

src/liballoc/raw_vec.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use super::oom;
1616
use super::boxed::Box;
1717
use core::ops::Drop;
1818
use core::cmp;
19-
use core;
2019

2120
/// A low-level utility for more ergonomically allocating, reallocating, and deallocating a
2221
/// a buffer of memory on the heap without having to worry about all the corner cases
@@ -584,7 +583,7 @@ impl<T> Drop for RawVec<T> {
584583

585584
#[inline]
586585
fn alloc_guard(alloc_size: usize) {
587-
if core::usize::BITS < 64 {
586+
if mem::size_of::<usize>() < 8 {
588587
assert!(alloc_size <= ::core::isize::MAX as usize,
589588
"capacity overflow");
590589
}

src/libcollections/borrow.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,19 +247,23 @@ impl<'a, B: ?Sized> Hash for Cow<'a, B> where B: Hash + ToOwned {
247247
/// Trait for moving into a `Cow`.
248248
#[unstable(feature = "into_cow", reason = "may be replaced by `convert::Into`",
249249
issue = "27735")]
250+
#[rustc_deprecated(since = "1.7.0",
251+
reason = "conflicts with Into, may return with specialization")]
250252
pub trait IntoCow<'a, B: ?Sized> where B: ToOwned {
251253
/// Moves `self` into `Cow`
252254
fn into_cow(self) -> Cow<'a, B>;
253255
}
254256

255257
#[stable(feature = "rust1", since = "1.0.0")]
258+
#[allow(deprecated)]
256259
impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned {
257260
fn into_cow(self) -> Cow<'a, B> {
258261
self
259262
}
260263
}
261264

262265
#[stable(feature = "rust1", since = "1.0.0")]
266+
#[allow(deprecated)]
263267
impl<'a, T: ?Sized + ToOwned> AsRef<T> for Cow<'a, T> {
264268
fn as_ref(&self) -> &T {
265269
self

src/libcollections/enum_set.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ pub trait CLike {
8181
fn from_usize(usize) -> Self;
8282
}
8383

84+
#[allow(deprecated)]
8485
fn bit<E: CLike>(e: &E) -> usize {
8586
use core::usize;
8687
let value = e.to_usize();

src/libcollections/fmt.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,11 @@ pub use core::fmt::{LowerExp, UpperExp};
490490
#[stable(feature = "rust1", since = "1.0.0")]
491491
pub use core::fmt::Error;
492492
#[stable(feature = "rust1", since = "1.0.0")]
493-
pub use core::fmt::{ArgumentV1, Arguments, write, radix, Radix, RadixFmt};
493+
pub use core::fmt::{ArgumentV1, Arguments, write};
494+
#[unstable(feature = "fmt_radix", issue = "27728")]
495+
#[rustc_deprecated(since = "1.7.0", reason = "not used enough to stabilize")]
496+
#[allow(deprecated)]
497+
pub use core::fmt::{radix, Radix, RadixFmt};
494498
#[stable(feature = "rust1", since = "1.0.0")]
495499
pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
496500

src/libcollections/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#![feature(alloc)]
3333
#![feature(box_patterns)]
3434
#![feature(box_syntax)]
35-
#![feature(clone_from_slice)]
3635
#![feature(core_intrinsics)]
3736
#![feature(decode_utf16)]
3837
#![feature(drop_in_place)]

src/libcollections/slice.rs

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -788,15 +788,12 @@ impl<T> [T] {
788788
/// # Examples
789789
///
790790
/// ```rust
791-
/// #![feature(slice_sort_by_key)]
792-
///
793791
/// let mut v = [-5i32, 4, 1, -3, 2];
794792
///
795793
/// v.sort_by_key(|k| k.abs());
796794
/// assert!(v == [1, 2, -3, 4, -5]);
797795
/// ```
798-
#[unstable(feature = "slice_sort_by_key", reason = "recently added",
799-
issue = "27724")]
796+
#[stable(feature = "slice_sort_by_key", since = "1.7.0")]
800797
#[inline]
801798
pub fn sort_by_key<B, F>(&mut self, mut f: F)
802799
where F: FnMut(&T) -> B, B: Ord
@@ -829,29 +826,25 @@ impl<T> [T] {
829826
merge_sort(self, compare)
830827
}
831828

832-
/// Copies as many elements from `src` as it can into `self` (the
833-
/// shorter of `self.len()` and `src.len()`). Returns the number
834-
/// of elements copied.
829+
/// Copies the elements from `src` into `self`.
830+
///
831+
/// The length of this slice must be the same as the slice passed in.
832+
///
833+
/// # Panics
834+
///
835+
/// This function will panic if the two slices have different lengths.
835836
///
836837
/// # Example
837838
///
838839
/// ```rust
839-
/// #![feature(clone_from_slice)]
840-
///
841840
/// let mut dst = [0, 0, 0];
842-
/// let src = [1, 2];
843-
///
844-
/// assert!(dst.clone_from_slice(&src) == 2);
845-
/// assert!(dst == [1, 2, 0]);
841+
/// let src = [1, 2, 3];
846842
///
847-
/// let src2 = [3, 4, 5, 6];
848-
/// assert!(dst.clone_from_slice(&src2) == 3);
849-
/// assert!(dst == [3, 4, 5]);
843+
/// dst.clone_from_slice(&src);
844+
/// assert!(dst == [1, 2, 3]);
850845
/// ```
851-
#[unstable(feature = "clone_from_slice", issue = "27750")]
852-
pub fn clone_from_slice(&mut self, src: &[T]) -> usize
853-
where T: Clone
854-
{
846+
#[stable(feature = "clone_from_slice", since = "1.7.0")]
847+
pub fn clone_from_slice(&mut self, src: &[T]) where T: Clone {
855848
core_slice::SliceExt::clone_from_slice(self, src)
856849
}
857850

0 commit comments

Comments
 (0)