Skip to content

Commit 19b9ff3

Browse files
committed
---
yaml --- r: 106215 b: refs/heads/auto c: aa39d75 h: refs/heads/master i: 106213: 64bb3f7 106211: 7cbf4eb 106207: 74088f2 v: v3
1 parent 78619fb commit 19b9ff3

Some content is hidden

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

60 files changed

+1371
-177
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 903e83889ade166bf62f1ee74df8bf8331ea17d1
16+
refs/heads/auto: aa39d755e3f9823b51cc57761c0c8c75759aca2e
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/compiletest/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
337337
}
338338
}
339339

340-
if tool_path.is_empty() {
340+
if tool_path.equals(&~"") {
341341
fatal(~"cannot found android cross path");
342342
}
343343

@@ -452,7 +452,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
452452
let options_to_remove = [~"-O", ~"-g", ~"--debuginfo"];
453453
let new_options = split_maybe_args(options).move_iter()
454454
.filter(|x| !options_to_remove.contains(x))
455-
.collect::<~[~str]>()
455+
.to_owned_vec()
456456
.connect(" ");
457457
Some(new_options)
458458
}

branches/auto/src/driver/driver.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[no_uv]; // remove this after stage0
12+
#[allow(attribute_usage)]; // remove this after stage0
13+
extern crate native; // remove this after stage0
14+
1115
#[cfg(rustdoc)]
1216
extern crate this = "rustdoc";
1317

branches/auto/src/libarena/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
html_root_url = "http://static.rust-lang.org/doc/master")];
2525
#[allow(missing_doc)];
2626
#[feature(managed_boxes)];
27+
#[allow(deprecated_owned_vector)]; // NOTE: remove after stage0
2728

2829
extern crate collections;
2930

branches/auto/src/libcollections/btree.rs

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,16 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for BTree<K, V> {
9494

9595
impl<K: TotalOrd, V: TotalEq> Eq for BTree<K, V> {
9696
fn eq(&self, other: &BTree<K, V>) -> bool {
97-
self.root.cmp(&other.root) == Equal
97+
self.equals(other)
9898
}
9999
}
100100

101-
impl<K: TotalOrd, V: TotalEq> TotalEq for BTree<K, V> {}
101+
impl<K: TotalOrd, V: TotalEq> TotalEq for BTree<K, V> {
102+
///Testing equality on BTrees by comparing the root.
103+
fn equals(&self, other: &BTree<K, V>) -> bool {
104+
self.root.cmp(&other.root) == Equal
105+
}
106+
}
102107

103108
impl<K: TotalOrd, V: TotalEq> Ord for BTree<K, V> {
104109
fn lt(&self, other: &BTree<K, V>) -> bool {
@@ -199,6 +204,14 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for Node<K, V> {
199204

200205
impl<K: TotalOrd, V: TotalEq> Eq for Node<K, V> {
201206
fn eq(&self, other: &Node<K, V>) -> bool {
207+
self.equals(other)
208+
}
209+
}
210+
211+
impl<K: TotalOrd, V: TotalEq> TotalEq for Node<K, V> {
212+
///Returns whether two nodes are equal based on the keys of each element.
213+
///Two nodes are equal if all of their keys are the same.
214+
fn equals(&self, other: &Node<K, V>) -> bool{
202215
match *self{
203216
BranchNode(ref branch) => {
204217
if other.is_leaf() {
@@ -219,8 +232,6 @@ impl<K: TotalOrd, V: TotalEq> Eq for Node<K, V> {
219232
}
220233
}
221234

222-
impl<K: TotalOrd, V: TotalEq> TotalEq for Node<K, V> {}
223-
224235
impl<K: TotalOrd, V: TotalEq> Ord for Node<K, V> {
225236
fn lt(&self, other: &Node<K, V>) -> bool {
226237
self.cmp(other) == Less
@@ -394,11 +405,16 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for Leaf<K, V> {
394405

395406
impl<K: TotalOrd, V: TotalEq> Eq for Leaf<K, V> {
396407
fn eq(&self, other: &Leaf<K, V>) -> bool {
397-
self.elts == other.elts
408+
self.equals(other)
398409
}
399410
}
400411

401-
impl<K: TotalOrd, V: TotalEq> TotalEq for Leaf<K, V> {}
412+
impl<K: TotalOrd, V: TotalEq> TotalEq for Leaf<K, V> {
413+
///Implementation of equals function for leaves that compares LeafElts.
414+
fn equals(&self, other: &Leaf<K, V>) -> bool {
415+
self.elts.equals(&other.elts)
416+
}
417+
}
402418

403419
impl<K: TotalOrd, V: TotalEq> Ord for Leaf<K, V> {
404420
fn lt(&self, other: &Leaf<K, V>) -> bool {
@@ -623,11 +639,16 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for Branch<K, V> {
623639

624640
impl<K: TotalOrd, V: TotalEq> Eq for Branch<K, V> {
625641
fn eq(&self, other: &Branch<K, V>) -> bool {
626-
self.elts == other.elts
642+
self.equals(other)
627643
}
628644
}
629645

630-
impl<K: TotalOrd, V: TotalEq> TotalEq for Branch<K, V> {}
646+
impl<K: TotalOrd, V: TotalEq> TotalEq for Branch<K, V> {
647+
///Equals function for Branches--compares all the elements in each branch
648+
fn equals(&self, other: &Branch<K, V>) -> bool {
649+
self.elts.equals(&other.elts)
650+
}
651+
}
631652

632653
impl<K: TotalOrd, V: TotalEq> Ord for Branch<K, V> {
633654
fn lt(&self, other: &Branch<K, V>) -> bool {
@@ -691,11 +712,16 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for LeafElt<K, V> {
691712

692713
impl<K: TotalOrd, V: TotalEq> Eq for LeafElt<K, V> {
693714
fn eq(&self, other: &LeafElt<K, V>) -> bool {
694-
self.key == other.key && self.value == other.value
715+
self.equals(other)
695716
}
696717
}
697718

698-
impl<K: TotalOrd, V: TotalEq> TotalEq for LeafElt<K, V> {}
719+
impl<K: TotalOrd, V: TotalEq> TotalEq for LeafElt<K, V> {
720+
///TotalEq for LeafElts
721+
fn equals(&self, other: &LeafElt<K, V>) -> bool {
722+
self.key.equals(&other.key) && self.value.equals(&other.value)
723+
}
724+
}
699725

700726
impl<K: TotalOrd, V: TotalEq> Ord for LeafElt<K, V> {
701727
fn lt(&self, other: &LeafElt<K, V>) -> bool {
@@ -740,11 +766,16 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for BranchElt<K, V> {
740766

741767
impl<K: TotalOrd, V: TotalEq> Eq for BranchElt<K, V>{
742768
fn eq(&self, other: &BranchElt<K, V>) -> bool {
743-
self.key == other.key && self.value == other.value
769+
self.equals(other)
744770
}
745771
}
746772

747-
impl<K: TotalOrd, V: TotalEq> TotalEq for BranchElt<K, V>{}
773+
impl<K: TotalOrd, V: TotalEq> TotalEq for BranchElt<K, V>{
774+
///TotalEq for BranchElts
775+
fn equals(&self, other: &BranchElt<K, V>) -> bool {
776+
self.key.equals(&other.key)&&self.value.equals(&other.value)
777+
}
778+
}
748779

749780
impl<K: TotalOrd, V: TotalEq> Ord for BranchElt<K, V> {
750781
fn lt(&self, other: &BranchElt<K, V>) -> bool {
@@ -869,7 +900,7 @@ mod test_btree {
869900
fn btree_clone_test() {
870901
let b = BTree::new(1, ~"abc", 2);
871902
let b2 = b.clone();
872-
assert!(b.root == b2.root)
903+
assert!(b.root.equals(&b2.root))
873904
}
874905
875906
//Tests the BTree's cmp() method when one node is "less than" another.

branches/auto/src/libcollections/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
html_root_url = "http://static.rust-lang.org/doc/master")];
2222

2323
#[feature(macro_rules, managed_boxes, default_type_params, phase)];
24+
#[allow(deprecated_owned_vector)]; // NOTE: remove after stage0
2425

2526
extern crate rand;
2627

branches/auto/src/libglob/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ impl Pattern {
223223
*/
224224
pub fn new(pattern: &str) -> Pattern {
225225

226-
let chars = pattern.chars().collect::<~[_]>();
226+
let chars = pattern.chars().to_owned_vec();
227227
let mut tokens = Vec::new();
228228
let mut i = 0;
229229

branches/auto/src/libgreen/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@
174174
// NB this does *not* include globs, please keep it that way.
175175
#[feature(macro_rules, phase)];
176176
#[allow(visible_private_types)];
177+
#[allow(deprecated_owned_vector)]; // NOTE: remove after stage0
177178

178179
#[cfg(test)] #[phase(syntax, link)] extern crate log;
179180
extern crate rand;

branches/auto/src/libnative/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
html_root_url = "http://static.rust-lang.org/doc/master")];
5151
#[deny(unused_result, unused_must_use)];
5252
#[allow(non_camel_case_types)];
53+
#[allow(deprecated_owned_vector)]; // NOTE: remove after stage0
5354

5455
// NB this crate explicitly does *not* allow glob imports, please seriously
5556
// consider whether they're needed before adding that feature here (the

branches/auto/src/libnum/bigint.rs

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,15 @@ pub struct BigUint {
9292

9393
impl Eq for BigUint {
9494
#[inline]
95-
fn eq(&self, other: &BigUint) -> bool {
95+
fn eq(&self, other: &BigUint) -> bool { self.equals(other) }
96+
}
97+
98+
impl TotalEq for BigUint {
99+
#[inline]
100+
fn equals(&self, other: &BigUint) -> bool {
96101
match self.cmp(other) { Equal => true, _ => false }
97102
}
98103
}
99-
impl TotalEq for BigUint {}
100104

101105
impl Ord for BigUint {
102106
#[inline]
@@ -848,9 +852,31 @@ fn get_radix_base(radix: uint) -> (uint, uint) {
848852
}
849853

850854
/// A Sign is a `BigInt`'s composing element.
851-
#[deriving(Eq, Ord, TotalEq, TotalOrd, Clone, Show)]
855+
#[deriving(Eq, Clone, Show)]
852856
pub enum Sign { Minus, Zero, Plus }
853857

858+
impl Ord for Sign {
859+
#[inline]
860+
fn lt(&self, other: &Sign) -> bool {
861+
match self.cmp(other) { Less => true, _ => false}
862+
}
863+
}
864+
865+
impl TotalEq for Sign {
866+
#[inline]
867+
fn equals(&self, other: &Sign) -> bool { *self == *other }
868+
}
869+
impl TotalOrd for Sign {
870+
#[inline]
871+
fn cmp(&self, other: &Sign) -> Ordering {
872+
match (*self, *other) {
873+
(Minus, Minus) | (Zero, Zero) | (Plus, Plus) => Equal,
874+
(Minus, Zero) | (Minus, Plus) | (Zero, Plus) => Less,
875+
_ => Greater
876+
}
877+
}
878+
}
879+
854880
impl Neg<Sign> for Sign {
855881
/// Negate Sign value.
856882
#[inline]
@@ -872,13 +898,16 @@ pub struct BigInt {
872898

873899
impl Eq for BigInt {
874900
#[inline]
875-
fn eq(&self, other: &BigInt) -> bool {
901+
fn eq(&self, other: &BigInt) -> bool { self.equals(other) }
902+
}
903+
904+
impl TotalEq for BigInt {
905+
#[inline]
906+
fn equals(&self, other: &BigInt) -> bool {
876907
match self.cmp(other) { Equal => true, _ => false }
877908
}
878909
}
879910

880-
impl TotalEq for BigInt {}
881-
882911
impl Ord for BigInt {
883912
#[inline]
884913
fn lt(&self, other: &BigInt) -> bool {

branches/auto/src/libnum/rational.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,20 @@ macro_rules! cmp_impl {
147147
cmp_impl!(impl $imp, $($method -> bool),+)
148148
};
149149
// return something other than a Ratio<T>
150-
(impl $imp:ident, $($method:ident -> $res:ty),*) => {
150+
(impl $imp:ident, $($method:ident -> $res:ty),+) => {
151151
impl<T: Mul<T,T> + $imp> $imp for Ratio<T> {
152152
$(
153153
#[inline]
154154
fn $method(&self, other: &Ratio<T>) -> $res {
155155
(self.numer * other.denom). $method (&(self.denom*other.numer))
156156
}
157-
)*
157+
)+
158158
}
159159
};
160160
}
161161
cmp_impl!(impl Eq, eq, ne)
162+
cmp_impl!(impl TotalEq, equals)
162163
cmp_impl!(impl Ord, lt, gt, le, ge)
163-
cmp_impl!(impl TotalEq, )
164164
cmp_impl!(impl TotalOrd, cmp -> cmp::Ordering)
165165

166166
/* Arithmetic */

branches/auto/src/librand/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ println!("{:?}", tuple_ptr)
7171
html_root_url = "http://static.rust-lang.org/doc/master")];
7272

7373
#[feature(macro_rules, managed_boxes, phase)];
74+
#[allow(deprecated_owned_vector)]; // NOTE: remove after stage0
7475

7576
#[cfg(test)]
7677
#[phase(syntax, link)] extern crate log;
@@ -825,7 +826,7 @@ mod test {
825826
let max_val = 100;
826827

827828
let mut r = task_rng();
828-
let vals = range(min_val, max_val).collect::<~[int]>();
829+
let vals = range(min_val, max_val).to_owned_vec();
829830
let small_sample = r.sample(vals.iter(), 5);
830831
let large_sample = r.sample(vals.iter(), vals.len() + 5);
831832

branches/auto/src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ This API is completely unstable and subject to change.
3030
#[allow(deprecated)];
3131
#[feature(macro_rules, globs, struct_variant, managed_boxes, quote,
3232
default_type_params, phase)];
33+
#[allow(deprecated_owned_vector)]; // NOTE: remove after stage0
3334

3435
extern crate flate;
3536
extern crate arena;

branches/auto/src/librustc/metadata/creader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ fn visit_item(e: &Env, i: &ast::Item) {
197197
} else {
198198
None
199199
})
200-
.collect::<~[&ast::Attribute]>();
200+
.to_owned_vec();
201201
for m in link_args.iter() {
202202
match m.value_str() {
203203
Some(linkarg) => e.sess.cstore.add_used_link_args(linkarg.get()),
@@ -212,7 +212,7 @@ fn visit_item(e: &Env, i: &ast::Item) {
212212
} else {
213213
None
214214
})
215-
.collect::<~[&ast::Attribute]>();
215+
.to_owned_vec();
216216
for m in link_args.iter() {
217217
match m.meta_item_list() {
218218
Some(items) => {

branches/auto/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ fn get_extern_rust_fn(ccx: &CrateContext, inputs: &[ty::t], output: ty::t,
236236

237237
let f = decl_rust_fn(ccx, false, inputs, output, name);
238238
csearch::get_item_attrs(&ccx.sess().cstore, did, |meta_items| {
239-
set_llvm_fn_attrs(meta_items.iter().map(|&x| attr::mk_attr(x)).collect::<~[_]>(), f)
239+
set_llvm_fn_attrs(meta_items.iter().map(|&x| attr::mk_attr(x)).to_owned_vec(), f)
240240
});
241241

242242
ccx.externs.borrow_mut().insert(name.to_owned(), f);

branches/auto/src/librustc/middle/trans/consts.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr,
538538
};
539539

540540
expr::with_field_tys(tcx, ety, Some(e.id), |discr, field_tys| {
541-
let (cs, inlineable) = slice::unzip(field_tys.iter().enumerate()
541+
let cs = field_tys.iter().enumerate()
542542
.map(|(ix, &field_ty)| {
543543
match fs.iter().find(|f| field_ty.ident.name == f.ident.node.name) {
544544
Some(f) => const_expr(cx, (*f).expr, is_local),
@@ -552,7 +552,8 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr,
552552
}
553553
}
554554
}
555-
}));
555+
}).to_owned_vec();
556+
let (cs, inlineable) = slice::unzip(cs.move_iter());
556557
(adt::trans_const(cx, repr, discr, cs),
557558
inlineable.iter().fold(true, |a, &b| a && b))
558559
})

branches/auto/src/librustdoc/html/markdown.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub fn render(w: &mut io::Writer, s: &str, print_toc: bool) -> fmt::Result {
133133
slice::raw::buf_as_slice((*text).data, (*text).size as uint, |text| {
134134
let text = str::from_utf8(text).unwrap();
135135
let mut lines = text.lines().filter(|l| stripped_filtered_line(*l).is_none());
136-
let text = lines.collect::<~[&str]>().connect("\n");
136+
let text = lines.to_owned_vec().connect("\n");
137137

138138
let buf = buf {
139139
data: text.as_bytes().as_ptr(),
@@ -186,7 +186,7 @@ pub fn render(w: &mut io::Writer, s: &str, print_toc: bool) -> fmt::Result {
186186
Some(s) => s.to_lower().into_str(),
187187
None => s.to_owned()
188188
}
189-
}).collect::<~[~str]>().connect("-");
189+
}).to_owned_vec().connect("-");
190190

191191
let opaque = unsafe {&mut *(opaque as *mut my_opaque)};
192192

@@ -284,7 +284,7 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) {
284284
let tests = &mut *(opaque as *mut ::test::Collector);
285285
let text = str::from_utf8(text).unwrap();
286286
let mut lines = text.lines().map(|l| stripped_filtered_line(l).unwrap_or(l));
287-
let text = lines.collect::<~[&str]>().connect("\n");
287+
let text = lines.to_owned_vec().connect("\n");
288288
tests.add_test(text, should_fail, no_run);
289289
})
290290
}

0 commit comments

Comments
 (0)