Skip to content

Commit 63ce511

Browse files
committed
---
yaml --- r: 218344 b: refs/heads/tmp c: 5b15923 h: refs/heads/master v: v3
1 parent 56d79f4 commit 63ce511

File tree

40 files changed

+268
-135
lines changed

40 files changed

+268
-135
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: ebf0c83cb9c6508e9564cb58337df2ad52b56430
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: a15c3c5ef5b05b5eb0b3bdfa2f3656fdac2f6606
28+
refs/heads/tmp: 5b15923026a8952f1b4939d73c69e01e04e3788b
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: d0fdfbfb0d34f196f52b9d15215723c4785c4afa
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/src/libcollections/bit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ impl BitVec {
283283
pub fn from_elem(nbits: usize, bit: bool) -> BitVec {
284284
let nblocks = blocks_for_bits(nbits);
285285
let mut bit_vec = BitVec {
286-
storage: repeat(if bit { !0 } else { 0 }).take(nblocks).collect(),
286+
storage: vec![if bit { !0 } else { 0 }; nblocks],
287287
nbits: nbits
288288
};
289289
bit_vec.fix_last_block();

branches/tmp/src/libcollectionstest/slice.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ mod bench {
13181318

13191319
#[bench]
13201320
fn mut_iterator(b: &mut Bencher) {
1321-
let mut v: Vec<_> = repeat(0).take(100).collect();
1321+
let mut v = vec![0; 100];
13221322

13231323
b.iter(|| {
13241324
let mut i = 0;
@@ -1419,7 +1419,7 @@ mod bench {
14191419
#[bench]
14201420
fn zero_1kb_from_elem(b: &mut Bencher) {
14211421
b.iter(|| {
1422-
repeat(0u8).take(1024).collect::<Vec<_>>()
1422+
vec![0u8; 1024]
14231423
});
14241424
}
14251425

@@ -1467,7 +1467,7 @@ mod bench {
14671467
fn random_inserts(b: &mut Bencher) {
14681468
let mut rng = thread_rng();
14691469
b.iter(|| {
1470-
let mut v: Vec<_> = repeat((0, 0)).take(30).collect();
1470+
let mut v = vec![(0, 0); 30];
14711471
for _ in 0..100 {
14721472
let l = v.len();
14731473
v.insert(rng.gen::<usize>() % (l + 1),
@@ -1479,7 +1479,7 @@ mod bench {
14791479
fn random_removes(b: &mut Bencher) {
14801480
let mut rng = thread_rng();
14811481
b.iter(|| {
1482-
let mut v: Vec<_> = repeat((0, 0)).take(130).collect();
1482+
let mut v = vec![(0, 0); 130];
14831483
for _ in 0..100 {
14841484
let l = v.len();
14851485
v.remove(rng.gen::<usize>() % l);

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ 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+
122132
#[stable(feature = "rust1", since = "1.0.0")]
123133
impl Not for Wrapping<$t> {
124134
type Output = Wrapping<$t>;

branches/tmp/src/libcore/slice.rs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,12 +1463,30 @@ 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-
self.len() == other.len() &&
1467-
order::eq(self.iter(), other.iter())
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
14681477
}
14691478
fn ne(&self, other: &[B]) -> bool {
1470-
self.len() != other.len() ||
1471-
order::ne(self.iter(), other.iter())
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
14721490
}
14731491
}
14741492

branches/tmp/src/libcoretest/ptr.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use core::ptr::*;
1212
use core::mem;
13-
use std::iter::repeat;
1413

1514
#[test]
1615
fn test() {
@@ -110,7 +109,7 @@ fn test_as_mut() {
110109
#[test]
111110
fn test_ptr_addition() {
112111
unsafe {
113-
let xs = repeat(5).take(16).collect::<Vec<_>>();
112+
let xs = vec![5; 16];
114113
let mut ptr = xs.as_ptr();
115114
let end = ptr.offset(16);
116115

@@ -128,7 +127,7 @@ fn test_ptr_addition() {
128127
m_ptr = m_ptr.offset(1);
129128
}
130129

131-
assert!(xs_mut == repeat(10).take(16).collect::<Vec<_>>());
130+
assert!(xs_mut == vec![10; 16]);
132131
}
133132
}
134133

branches/tmp/src/libgraphviz/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,6 @@ mod tests {
599599
use std::io;
600600
use std::io::prelude::*;
601601
use std::borrow::IntoCow;
602-
use std::iter::repeat;
603602

604603
/// each node is an index in a vector in the graph.
605604
type Node = usize;
@@ -647,7 +646,7 @@ mod tests {
647646
fn to_opt_strs(self) -> Vec<Option<&'static str>> {
648647
match self {
649648
UnlabelledNodes(len)
650-
=> repeat(None).take(len).collect(),
649+
=> vec![None; len],
651650
AllNodesLabelled(lbls)
652651
=> lbls.into_iter().map(
653652
|l|Some(l)).collect(),

branches/tmp/src/librand/reseeding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ mod tests {
186186
const FILL_BYTES_V_LEN: usize = 13579;
187187
#[test]
188188
fn test_rng_fill_bytes() {
189-
let mut v = repeat(0).take(FILL_BYTES_V_LEN).collect::<Vec<_>>();
189+
let mut v = vec![0; FILL_BYTES_V_LEN];
190190
::test::rng().fill_bytes(&mut v);
191191

192192
// Sanity test: if we've gotten here, `fill_bytes` has not infinitely

branches/tmp/src/librustc/diagnostics.rs

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

branches/tmp/src/librustc/middle/check_match.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ fn is_useful(cx: &MatchCheckCtxt,
704704
match is_useful(cx, &matrix, v.tail(), witness) {
705705
UsefulWithWitness(pats) => {
706706
let arity = constructor_arity(cx, &constructor, left_ty);
707-
let wild_pats: Vec<_> = repeat(DUMMY_WILD_PAT).take(arity).collect();
707+
let wild_pats = vec![DUMMY_WILD_PAT; arity];
708708
let enum_pat = construct_witness(cx, &constructor, wild_pats, left_ty);
709709
let mut new_pats = vec![enum_pat];
710710
new_pats.extend(pats);
@@ -862,7 +862,7 @@ pub fn specialize<'a>(cx: &MatchCheckCtxt, r: &[&'a Pat],
862862
} = raw_pat(r[col]);
863863
let head: Option<Vec<&Pat>> = match *node {
864864
ast::PatWild(_) =>
865-
Some(repeat(DUMMY_WILD_PAT).take(arity).collect()),
865+
Some(vec![DUMMY_WILD_PAT; arity]),
866866

867867
ast::PatIdent(_, _, _) => {
868868
let opt_def = cx.tcx.def_map.borrow().get(&pat_id).map(|d| d.full_def());
@@ -875,7 +875,7 @@ pub fn specialize<'a>(cx: &MatchCheckCtxt, r: &[&'a Pat],
875875
} else {
876876
None
877877
},
878-
_ => Some(repeat(DUMMY_WILD_PAT).take(arity).collect())
878+
_ => Some(vec![DUMMY_WILD_PAT; arity])
879879
}
880880
}
881881

@@ -889,7 +889,7 @@ pub fn specialize<'a>(cx: &MatchCheckCtxt, r: &[&'a Pat],
889889
DefVariant(..) | DefStruct(..) => {
890890
Some(match args {
891891
&Some(ref args) => args.iter().map(|p| &**p).collect(),
892-
&None => repeat(DUMMY_WILD_PAT).take(arity).collect(),
892+
&None => vec![DUMMY_WILD_PAT; arity],
893893
})
894894
}
895895
_ => None

0 commit comments

Comments
 (0)