Skip to content

Commit 7b52bf4

Browse files
committed
---
yaml --- r: 235285 b: refs/heads/stable c: 830e82d h: refs/heads/master i: 235283: 426cb19 v: v3
1 parent fafa0a0 commit 7b52bf4

File tree

32 files changed

+329
-639
lines changed

32 files changed

+329
-639
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 9c3ba763891b0fe626adefc19ad7908b0862a41c
32+
refs/heads/stable: 830e82df1427b266ff5ed5edee95bb1f1282eb35
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/liballoc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,4 @@ pub fn oom() -> ! {
148148
// optimize it out).
149149
#[doc(hidden)]
150150
#[unstable(feature = "issue_14344_fixme")]
151-
#[cfg(stage0)]
152151
pub fn fixme_14344_be_sure_to_link_to_collections() {}

branches/stable/src/libcollections/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ pub mod btree_set {
138138
// FIXME(#14344) this shouldn't be necessary
139139
#[doc(hidden)]
140140
#[unstable(feature = "issue_14344_fixme")]
141-
#[cfg(stage0)]
142141
pub fn fixme_14344_be_sure_to_link_to_collections() {}
143142

144143
#[cfg(not(test))]

branches/stable/src/libcollections/vec.rs

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ use core::cmp::Ordering;
6767
use core::fmt;
6868
use core::hash::{self, Hash};
6969
use core::intrinsics::{arith_offset, assume};
70-
use core::iter::FromIterator;
70+
use core::iter::{repeat, FromIterator};
7171
use core::marker::PhantomData;
7272
use core::mem;
7373
use core::ops::{Index, IndexMut, Deref};
@@ -1106,35 +1106,12 @@ impl<T: Clone> Vec<T> {
11061106
let len = self.len();
11071107

11081108
if new_len > len {
1109-
self.extend_with_element(new_len - len, value);
1109+
self.extend(repeat(value).take(new_len - len));
11101110
} else {
11111111
self.truncate(new_len);
11121112
}
11131113
}
11141114

1115-
/// Extend the vector by `n` additional clones of `value`.
1116-
fn extend_with_element(&mut self, n: usize, value: T) {
1117-
self.reserve(n);
1118-
1119-
unsafe {
1120-
let len = self.len();
1121-
let mut ptr = self.as_mut_ptr().offset(len as isize);
1122-
// Write all elements except the last one
1123-
for i in 1..n {
1124-
ptr::write(ptr, value.clone());
1125-
ptr = ptr.offset(1);
1126-
// Increment the length in every step in case clone() panics
1127-
self.set_len(len + i);
1128-
}
1129-
1130-
if n > 0 {
1131-
// We can write the last element directly without cloning needlessly
1132-
ptr::write(ptr, value);
1133-
self.set_len(len + n);
1134-
}
1135-
}
1136-
}
1137-
11381115
/// Appends all elements in a slice to the `Vec`.
11391116
///
11401117
/// Iterates over the slice `other`, clones each element, and then appends
@@ -1317,9 +1294,25 @@ unsafe fn dealloc<T>(ptr: *mut T, len: usize) {
13171294
#[doc(hidden)]
13181295
#[stable(feature = "rust1", since = "1.0.0")]
13191296
pub fn from_elem<T: Clone>(elem: T, n: usize) -> Vec<T> {
1320-
let mut v = Vec::with_capacity(n);
1321-
v.extend_with_element(n, elem);
1322-
v
1297+
unsafe {
1298+
let mut v = Vec::with_capacity(n);
1299+
let mut ptr = v.as_mut_ptr();
1300+
1301+
// Write all elements except the last one
1302+
for i in 1..n {
1303+
ptr::write(ptr, Clone::clone(&elem));
1304+
ptr = ptr.offset(1);
1305+
v.set_len(i); // Increment the length in every step in case Clone::clone() panics
1306+
}
1307+
1308+
if n > 0 {
1309+
// We can write the last element directly without cloning needlessly
1310+
ptr::write(ptr, elem);
1311+
v.set_len(n);
1312+
}
1313+
1314+
v
1315+
}
13231316
}
13241317

13251318
////////////////////////////////////////////////////////////////////////////////

branches/stable/src/libcore/num/wrapping.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,6 @@ macro_rules! wrapping_impl {
119119
}
120120
}
121121

122-
#[stable(feature = "wrapping_div", since = "1.3.0")]
123-
impl Div for Wrapping<$t> {
124-
type Output = Wrapping<$t>;
125-
126-
#[inline(always)]
127-
fn div(self, other: Wrapping<$t>) -> Wrapping<$t> {
128-
Wrapping(self.0.wrapping_div(other.0))
129-
}
130-
}
131-
132122
#[stable(feature = "rust1", since = "1.0.0")]
133123
impl Not for Wrapping<$t> {
134124
type Output = Wrapping<$t>;

branches/stable/src/libcore/slice.rs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,30 +1463,12 @@ pub mod bytes {
14631463
#[stable(feature = "rust1", since = "1.0.0")]
14641464
impl<A, B> PartialEq<[B]> for [A] where A: PartialEq<B> {
14651465
fn eq(&self, other: &[B]) -> bool {
1466-
if self.len() != other.len() {
1467-
return false;
1468-
}
1469-
1470-
for i in 0..self.len() {
1471-
if !self[i].eq(&other[i]) {
1472-
return false;
1473-
}
1474-
}
1475-
1476-
true
1466+
self.len() == other.len() &&
1467+
order::eq(self.iter(), other.iter())
14771468
}
14781469
fn ne(&self, other: &[B]) -> bool {
1479-
if self.len() != other.len() {
1480-
return true;
1481-
}
1482-
1483-
for i in 0..self.len() {
1484-
if self[i].ne(&other[i]) {
1485-
return true;
1486-
}
1487-
}
1488-
1489-
false
1470+
self.len() != other.len() ||
1471+
order::ne(self.iter(), other.iter())
14901472
}
14911473
}
14921474

branches/stable/src/liblibc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6431,7 +6431,6 @@ pub mod funcs {
64316431
}
64326432

64336433
#[doc(hidden)]
6434-
#[cfg(stage0)]
64356434
pub fn issue_14344_workaround() {} // FIXME #14344 force linkage to happen correctly
64366435

64376436
#[test] fn work_on_windows() { } // FIXME #10872 needed for a happy windows

branches/stable/src/librustc/diagnostics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,7 @@ register_diagnostics! {
12111211
E0138,
12121212
E0139,
12131213
E0264, // unknown external lang item
1214+
E0266, // expected item
12141215
E0269, // not all control paths return a value
12151216
E0270, // computation may converge in a function marked as diverging
12161217
E0272, // rustc_on_unimplemented attribute refers to non-existent type parameter

branches/stable/src/librustc/metadata/encoder.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,11 @@ fn encode_metadata_inner(wr: &mut Cursor<Vec<u8>>,
21362136
let mut rbml_w = Encoder::new(wr);
21372137

21382138
encode_crate_name(&mut rbml_w, &ecx.link_meta.crate_name);
2139-
encode_crate_triple(&mut rbml_w, &tcx.sess.opts.target_triple);
2139+
encode_crate_triple(&mut rbml_w,
2140+
&tcx.sess
2141+
.opts
2142+
.target_triple
2143+
);
21402144
encode_hash(&mut rbml_w, &ecx.link_meta.crate_hash);
21412145
encode_dylib_dependency_formats(&mut rbml_w, &ecx);
21422146

0 commit comments

Comments
 (0)