Skip to content

Commit 009d84e

Browse files
committed
---
yaml --- r: 101278 b: refs/heads/snap-stage3 c: e2afa1c h: refs/heads/master v: v3
1 parent dc81124 commit 009d84e

File tree

118 files changed

+468
-735
lines changed

Some content is hidden

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

118 files changed

+468
-735
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e3b1f3c443c048913e2d573fcc5a9c2be3484a78
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: b349fee46e393db4cfd8bcf6f89d770a26c9e077
4+
refs/heads/snap-stage3: e2afa1cd5caef171353707c9d1acde78541b40f7
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/doc/guide-container.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ the trailing underscore is a workaround for issue #5898 and will be removed.
384384
~~~
385385
let mut ys = [1, 2, 3, 4, 5];
386386
ys.mut_iter().reverse_();
387-
assert!(ys == [5, 4, 3, 2, 1]);
387+
assert_eq!(ys, [5, 4, 3, 2, 1]);
388388
~~~
389389

390390
## Random-access iterators

branches/snap-stage3/src/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ let x = Rc::new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
16881688
let y = x.clone(); // a new owner
16891689
let z = x; // this moves `x` into `z`, rather than creating a new owner
16901690

1691-
assert!(*z.borrow() == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
1691+
assert_eq!(*z.borrow(), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
16921692

16931693
// the variable is mutable, but not the contents of the box
16941694
let mut a = Rc::new([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]);
@@ -1707,7 +1707,7 @@ let x = Gc::new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
17071707
let y = x; // does not perform a move, unlike with `Rc`
17081708
let z = x;
17091709

1710-
assert!(*z.borrow() == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
1710+
assert_eq!(*z.borrow(), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
17111711
~~~
17121712
17131713
With shared ownership, mutability cannot be inherited so the boxes are always immutable. However,

branches/snap-stage3/src/etc/vim/syntax/rust.vim

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,11 @@ syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[
163163
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
164164
syn match rustCharacter /'\([^'\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial,rustSpecialError
165165

166-
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
167-
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
168-
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell
169-
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell
170-
syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent
171-
syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent
166+
syn cluster rustComment contains=rustCommentLine,rustCommentLineDoc,rustCommentBlock,rustCommentBlockDoc
167+
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
168+
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
169+
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,@rustComment,@Spell keepend extend
170+
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,@rustComment,@Spell keepend extend
172171
" FIXME: this is a really ugly and not fully correct implementation. Most
173172
" importantly, a case like ``/* */*`` should have the final ``*`` not being in
174173
" a comment, but in practice at present it leaves comments open two levels

branches/snap-stage3/src/libcollections/bitv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ mod tests {
15421542

15431543
let mut b = a.clone();
15441544

1545-
assert!(a == b);
1545+
assert_eq!(&a, &b);
15461546

15471547
assert!(b.remove(&1));
15481548
assert!(a.contains(&1));
@@ -1561,7 +1561,7 @@ mod tests {
15611561
let mut r = rng();
15621562
let mut bitv = 0 as uint;
15631563
b.iter(|| {
1564-
bitv |= 1 << ((r.next_u32() as uint) % uint::BITS);
1564+
bitv |= (1 << ((r.next_u32() as uint) % uint::BITS));
15651565
&bitv
15661566
})
15671567
}

branches/snap-stage3/src/libcollections/dlist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,11 +982,11 @@ mod tests {
982982
fn test_eq() {
983983
let mut n: DList<u8> = list_from([]);
984984
let mut m = list_from([]);
985-
assert!(n == m);
985+
assert_eq!(&n, &m);
986986
n.push_front(1);
987987
assert!(n != m);
988988
m.push_back(1);
989-
assert!(n == m);
989+
assert_eq!(&n, &m);
990990

991991
let n = list_from([2,3,4]);
992992
let m = list_from([1,2,3]);

branches/snap-stage3/src/libcollections/enum_set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ mod test {
141141

142142
use enum_set::{EnumSet, CLike};
143143

144-
#[deriving(Eq, Show)]
144+
#[deriving(Eq)]
145145
#[repr(uint)]
146146
enum Foo {
147147
A, B, C

branches/snap-stage3/src/libcollections/hashmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ mod test_map {
10651065
let mut observed = 0;
10661066
for (k, v) in m.iter() {
10671067
assert_eq!(*v, *k * 2);
1068-
observed |= 1 << *k;
1068+
observed |= (1 << *k);
10691069
}
10701070
assert_eq!(observed, 0xFFFF_FFFF);
10711071
}
@@ -1293,7 +1293,7 @@ mod test_set {
12931293
}
12941294
let mut observed = 0;
12951295
for k in a.iter() {
1296-
observed |= 1 << *k;
1296+
observed |= (1 << *k);
12971297
}
12981298
assert_eq!(observed, 0xFFFF_FFFF);
12991299
}

branches/snap-stage3/src/libcollections/list.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ mod tests {
153153
#[test]
154154
fn test_from_vec_empty() {
155155
let empty : list::List<int> = List::from_vec([]);
156-
assert!(empty == Nil::<int>);
156+
assert_eq!(empty, Nil::<int>);
157157
}
158158

159159
#[test]
@@ -222,8 +222,8 @@ mod tests {
222222

223223
#[test]
224224
fn test_append() {
225-
assert!(List::from_vec([1, 2, 3, 4]) ==
226-
List::from_vec([1, 2]).append(List::from_vec([3, 4])));
225+
assert_eq!(List::from_vec([1, 2, 3, 4]),
226+
List::from_vec([1, 2]).append(List::from_vec([3, 4])));
227227
}
228228

229229
#[test]
@@ -232,6 +232,6 @@ mod tests {
232232
let new_list = list.unshift(0);
233233
assert_eq!(list.len(), 1u);
234234
assert_eq!(new_list.len(), 2u);
235-
assert!(new_list == List::from_vec([0, 1]));
235+
assert_eq!(new_list, List::from_vec([0, 1]));
236236
}
237237
}

branches/snap-stage3/src/libcollections/lru_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ mod tests {
277277

278278
fn assert_opt_eq<V: Eq>(opt: Option<&V>, v: V) {
279279
assert!(opt.is_some());
280-
assert!(opt.unwrap() == &v);
280+
assert_eq!(opt.unwrap(), &v);
281281
}
282282

283283
#[test]

branches/snap-stage3/src/libcollections/ringbuf.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ mod tests {
409409
use deque::Deque;
410410
use std::clone::Clone;
411411
use std::cmp::Eq;
412-
use std::fmt::Show;
413412
use super::RingBuf;
414413

415414
#[test]
@@ -494,7 +493,7 @@ mod tests {
494493
}
495494

496495
#[cfg(test)]
497-
fn test_parameterized<T:Clone + Eq + Show>(a: T, b: T, c: T, d: T) {
496+
fn test_parameterized<T:Clone + Eq>(a: T, b: T, c: T, d: T) {
498497
let mut deq = RingBuf::new();
499498
assert_eq!(deq.len(), 0);
500499
deq.push_front(a.clone());
@@ -579,21 +578,21 @@ mod tests {
579578
})
580579
}
581580

582-
#[deriving(Clone, Eq, Show)]
581+
#[deriving(Clone, Eq)]
583582
enum Taggy {
584583
One(int),
585584
Two(int, int),
586585
Three(int, int, int),
587586
}
588587

589-
#[deriving(Clone, Eq, Show)]
588+
#[deriving(Clone, Eq)]
590589
enum Taggypar<T> {
591590
Onepar(int),
592591
Twopar(int, int),
593592
Threepar(int, int, int),
594593
}
595594

596-
#[deriving(Clone, Eq, Show)]
595+
#[deriving(Clone, Eq)]
597596
struct RecCy {
598597
x: int,
599598
y: int,
@@ -813,7 +812,7 @@ mod tests {
813812
#[test]
814813
fn test_eq() {
815814
let mut d = RingBuf::new();
816-
assert!(d == RingBuf::with_capacity(0));
815+
assert_eq!(&d, &RingBuf::with_capacity(0));
817816
d.push_front(137);
818817
d.push_front(17);
819818
d.push_front(42);
@@ -823,11 +822,11 @@ mod tests {
823822
e.push_back(17);
824823
e.push_back(137);
825824
e.push_back(137);
826-
assert!(&e == &d);
825+
assert_eq!(&e, &d);
827826
e.pop_back();
828827
e.push_back(0);
829828
assert!(e != d);
830829
e.clear();
831-
assert!(e == RingBuf::new());
830+
assert_eq!(e, RingBuf::new());
832831
}
833832
}

branches/snap-stage3/src/libgetopts/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ mod tests {
13611361
aliases: ~[] }];
13621362
let verbose = reqopt("b", "banana", "some bananas", "VAL");
13631363
1364-
assert!(verbose.long_to_short() == short);
1364+
assert_eq!(verbose.long_to_short(), short);
13651365
}
13661366
13671367
#[test]

branches/snap-stage3/src/libnum/bigint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ fn get_radix_base(radix: uint) -> (uint, uint) {
829829
}
830830

831831
/// A Sign is a `BigInt`'s composing element.
832-
#[deriving(Eq, Clone, Show)]
832+
#[deriving(Eq, Clone)]
833833
pub enum Sign { Minus, Zero, Plus }
834834

835835
impl Ord for Sign {

branches/snap-stage3/src/librustc/back/rpath.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ mod test {
215215
#[test]
216216
fn test_minimize1() {
217217
let res = minimize_rpaths([~"rpath1", ~"rpath2", ~"rpath1"]);
218-
assert!(res.as_slice() == [~"rpath1", ~"rpath2"]);
218+
assert_eq!(res.as_slice(), [~"rpath1", ~"rpath2"]);
219219
}
220220
221221
#[test]
@@ -224,7 +224,7 @@ mod test {
224224
~"1a", ~"4a", ~"1a",
225225
~"2", ~"3", ~"4a",
226226
~"3"]);
227-
assert!(res.as_slice() == [~"1a", ~"2", ~"4a", ~"3"]);
227+
assert_eq!(res.as_slice(), [~"1a", ~"2", ~"4a", ~"3"]);
228228
}
229229
230230
#[test]

branches/snap-stage3/src/librustc/driver/driver.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ pub fn build_session(sopts: @session::Options,
930930
-> Session {
931931
let codemap = @codemap::CodeMap::new();
932932
let diagnostic_handler =
933-
diagnostic::default_handler();
933+
diagnostic::mk_handler();
934934
let span_diagnostic_handler =
935935
diagnostic::mk_span_handler(diagnostic_handler, codemap);
936936

@@ -1148,8 +1148,7 @@ pub fn build_output_filenames(input: &Input,
11481148
}
11491149

11501150
pub fn early_error(msg: &str) -> ! {
1151-
let mut emitter = diagnostic::EmitterWriter::stderr();
1152-
emitter.emit(None, msg, diagnostic::Fatal);
1151+
diagnostic::DefaultEmitter.emit(None, msg, diagnostic::Fatal);
11531152
fail!(diagnostic::FatalError);
11541153
}
11551154

branches/snap-stage3/src/librustc/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ pub fn run_compiler(args: &[~str]) {
297297
match input {
298298
d::FileInput(ref ifile) => {
299299
let mut stdout = io::stdout();
300-
d::list_metadata(sess, &(*ifile), &mut stdout).unwrap();
300+
d::list_metadata(sess, &(*ifile),
301+
&mut stdout as &mut io::Writer).unwrap();
301302
}
302303
d::StrInput(_) => {
303304
d::early_error("can not list metadata for stdin");
@@ -383,8 +384,7 @@ pub fn monitor(f: proc()) {
383384
Err(value) => {
384385
// Task failed without emitting a fatal diagnostic
385386
if !value.is::<diagnostic::FatalError>() {
386-
let mut emitter = diagnostic::EmitterWriter::stderr();
387-
emitter.emit(
387+
diagnostic::DefaultEmitter.emit(
388388
None,
389389
diagnostic::ice_msg("unexpected failure"),
390390
diagnostic::Error);
@@ -394,7 +394,9 @@ pub fn monitor(f: proc()) {
394394
this is a bug",
395395
];
396396
for note in xs.iter() {
397-
emitter.emit(None, *note, diagnostic::Note)
397+
diagnostic::DefaultEmitter.emit(None,
398+
*note,
399+
diagnostic::Note)
398400
}
399401

400402
println!("{}", r.read_to_str());

branches/snap-stage3/src/librustc/middle/astencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ fn roundtrip(in_item: Option<@ast::Item>) {
14681468
let ebml_doc = reader::Doc(wr.get_ref());
14691469
let out_item = decode_item_ast(ebml_doc);
14701470

1471-
assert!(in_item == out_item);
1471+
assert_eq!(in_item, out_item);
14721472
}
14731473

14741474
#[test]

branches/snap-stage3/src/librustc/middle/graph.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -349,19 +349,19 @@ mod test {
349349
start_data: N,
350350
expected_incoming: &[(E,N)],
351351
expected_outgoing: &[(E,N)]) {
352-
assert!(graph.node_data(start_index) == &start_data);
352+
assert_eq!(graph.node_data(start_index), &start_data);
353353

354354
let mut counter = 0;
355355
graph.each_incoming_edge(start_index, |edge_index, edge| {
356-
assert!(graph.edge_data(edge_index) == &edge.data);
356+
assert_eq!(graph.edge_data(edge_index), &edge.data);
357357
assert!(counter < expected_incoming.len());
358358
debug!("counter={:?} expected={:?} edge_index={:?} edge={:?}",
359359
counter, expected_incoming[counter], edge_index, edge);
360360
match expected_incoming[counter] {
361361
(ref e, ref n) => {
362-
assert!(e == &edge.data);
363-
assert!(n == graph.node_data(edge.source));
364-
assert!(start_index == edge.target);
362+
assert_eq!(e, &edge.data);
363+
assert_eq!(n, graph.node_data(edge.source));
364+
assert_eq!(start_index, edge.target);
365365
}
366366
}
367367
counter += 1;
@@ -371,15 +371,15 @@ mod test {
371371

372372
let mut counter = 0;
373373
graph.each_outgoing_edge(start_index, |edge_index, edge| {
374-
assert!(graph.edge_data(edge_index) == &edge.data);
374+
assert_eq!(graph.edge_data(edge_index), &edge.data);
375375
assert!(counter < expected_outgoing.len());
376376
debug!("counter={:?} expected={:?} edge_index={:?} edge={:?}",
377377
counter, expected_outgoing[counter], edge_index, edge);
378378
match expected_outgoing[counter] {
379379
(ref e, ref n) => {
380-
assert!(e == &edge.data);
381-
assert!(start_index == edge.source);
382-
assert!(n == graph.node_data(edge.target));
380+
assert_eq!(e, &edge.data);
381+
assert_eq!(start_index, edge.source);
382+
assert_eq!(n, graph.node_data(edge.target));
383383
}
384384
}
385385
counter += 1;

branches/snap-stage3/src/librustc/middle/trans/_match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ impl<'a> DynamicFailureHandler<'a> {
11881188

11891189
let fcx = self.bcx.fcx;
11901190
let fail_cx = fcx.new_block(false, "case_fallthrough", None);
1191-
controlflow::trans_fail(fail_cx, Some(self.sp), self.msg.clone());
1191+
controlflow::trans_fail(fail_cx, self.sp, self.msg.clone());
11921192
self.finished.set(Some(fail_cx.llbb));
11931193
fail_cx.llbb
11941194
}
@@ -1528,7 +1528,7 @@ fn compile_submatch_continue<'r,
15281528
Some(ref rec_fields) => {
15291529
let pat_ty = node_id_type(bcx, pat_id);
15301530
let pat_repr = adt::represent_type(bcx.ccx(), pat_ty);
1531-
expr::with_field_tys(tcx, pat_ty, Some(pat_id), |discr, field_tys| {
1531+
expr::with_field_tys(tcx, pat_ty, None, |discr, field_tys| {
15321532
let rec_vals = rec_fields.map(|field_name| {
15331533
let ix = ty::field_idx_strict(tcx, field_name.name, field_tys);
15341534
adt::trans_field_ptr(bcx, pat_repr, val, discr, ix)
@@ -2208,7 +2208,7 @@ fn bind_irrefutable_pat<'a>(
22082208
let tcx = bcx.tcx();
22092209
let pat_ty = node_id_type(bcx, pat.id);
22102210
let pat_repr = adt::represent_type(bcx.ccx(), pat_ty);
2211-
expr::with_field_tys(tcx, pat_ty, Some(pat.id), |discr, field_tys| {
2211+
expr::with_field_tys(tcx, pat_ty, None, |discr, field_tys| {
22122212
for f in fields.iter() {
22132213
let ix = ty::field_idx_strict(tcx, f.ident.name, field_tys);
22142214
let fldptr = adt::trans_field_ptr(bcx, pat_repr, val,

branches/snap-stage3/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ pub fn fail_if_zero<'a>(
864864
}
865865
};
866866
with_cond(cx, is_zero, |bcx| {
867-
controlflow::trans_fail(bcx, Some(span), InternedString::new(text))
867+
controlflow::trans_fail(bcx, span, InternedString::new(text))
868868
})
869869
}
870870

0 commit comments

Comments
 (0)