Skip to content

Commit b1276b9

Browse files
committed
---
yaml --- r: 16303 b: refs/heads/try c: bede54b h: refs/heads/master i: 16301: 691ae9a 16299: b1bd25a 16295: 967eb82 16287: c9eab6a v: v3
1 parent 85a2b81 commit b1276b9

35 files changed

+196
-290
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: d542e67827e0ad1a3df5fd248d9c09997b5dcbba
5+
refs/heads/try: bede54b14acb093e86a936d5ba62ff2af8b558d5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/Makefile.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@ else
421421
TSREQS := \
422422
$(foreach target,$(CFG_TARGET_TRIPLES), \
423423
$(SREQ3_T_$(target)_H_$(CFG_HOST_TRIPLE)))
424-
FUZZ := $(HBIN2_H_$(CFG_HOST_TRIPLE))/fuzzer$(X)
425-
CARGO := $(HBIN2_H_$(CFG_HOST_TRIPLE))/cargo$(X)
426-
RUSTDOC := $(HBIN2_H_$(CFG_HOST_TRIPLE))/rustdoc$(X)
424+
FUZZ := $(HBIN3_H_$(CFG_HOST_TRIPLE))/fuzzer$(X)
425+
CARGO := $(HBIN3_H_$(CFG_HOST_TRIPLE))/cargo$(X)
426+
RUSTDOC := $(HBIN3_H_$(CFG_HOST_TRIPLE))/rustdoc$(X)
427427

428428
all: rustc $(GENERATED) docs $(FUZZ) $(CARGO) $(RUSTDOC)
429429

branches/try/src/libcore/cmp.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

branches/try/src/libcore/core.rc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ export comm, task, future;
4343
export extfmt;
4444
export tuple;
4545
export to_str;
46-
export swappable;
4746
export dvec, dvec_iter;
48-
export cmp;
4947

5048
// NDM seems to be necessary for resolve to work
5149
export option_iter;
@@ -154,7 +152,6 @@ mod tuple;
154152

155153
// Ubiquitous-utility-type modules
156154

157-
mod cmp;
158155
mod either;
159156
mod iter;
160157
mod logging;
@@ -166,7 +163,6 @@ mod option_iter {
166163
}
167164
mod result;
168165
mod to_str;
169-
mod swappable;
170166
mod dvec;
171167
#[path="iter-trait"]
172168
mod dvec_iter {

branches/try/src/libcore/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fn get<A:copy>(future: future<A>) -> A {
108108
fn with<A,B>(future: future<A>, blk: fn(A) -> B) -> B {
109109
#[doc = "Work with the value without copying it"];
110110

111-
let v = alt future.v {
111+
let v = alt copy future.v {
112112
either::left(v) { v }
113113
either::right(f) {
114114
let v = @f();

branches/try/src/libcore/int-template.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import T = inst::T;
2-
import cmp::{eq, ord};
32

43
export min_value, max_value;
54
export min, max;
@@ -11,7 +10,6 @@ export range;
1110
export compl;
1211
export abs;
1312
export parse_buf, from_str, to_str, to_str_bytes, str;
14-
export ord, eq;
1513

1614
const min_value: T = -1 as T << (inst::bits - 1 as T);
1715
const max_value: T = min_value - 1 as T;
@@ -110,18 +108,6 @@ fn to_str_bytes<U>(n: T, radix: uint, f: fn([u8]/&) -> U) -> U {
110108
#[doc = "Convert to a string"]
111109
fn str(i: T) -> str { ret to_str(i, 10u); }
112110

113-
impl ord of ord for T {
114-
fn lt(&&other: T) -> bool {
115-
ret self < other;
116-
}
117-
}
118-
119-
impl eq of eq for T {
120-
fn eq(&&other: T) -> bool {
121-
ret self == other;
122-
}
123-
}
124-
125111

126112
// FIXME: Has alignment issues on windows and 32-bit linux
127113
#[test]

branches/try/src/libcore/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ impl of writer for mem_buffer {
613613
// FIXME #2004--use memcpy here?
614614
let mut pos = self.pos, vpos = 0u;
615615
while vpos < vlen && pos < buf_len {
616-
self.buf.set_elt(pos, v[vpos]);
616+
self.buf.set_elt(pos, copy v[vpos]);
617617
pos += 1u;
618618
vpos += 1u;
619619
}

branches/try/src/libcore/swappable.rs

Lines changed: 0 additions & 98 deletions
This file was deleted.

branches/try/src/libcore/uint-template.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import T = inst::T;
2-
import cmp::{eq, ord};
32

43
export min_value, max_value;
54
export min, max;
@@ -11,7 +10,6 @@ export range;
1110
export compl;
1211
export to_str, to_str_bytes;
1312
export from_str, from_str_radix, str, parse_buf;
14-
export ord, eq;
1513

1614
const min_value: T = 0 as T;
1715
const max_value: T = 0 as T - 1 as T;
@@ -51,18 +49,6 @@ pure fn compl(i: T) -> T {
5149
max_value ^ i
5250
}
5351

54-
impl ord of ord for T {
55-
fn lt(&&other: T) -> bool {
56-
ret self < other;
57-
}
58-
}
59-
60-
impl eq of eq for T {
61-
fn eq(&&other: T) -> bool {
62-
ret self == other;
63-
}
64-
}
65-
6652
#[doc = "
6753
Parse a buffer of bytes
6854

branches/try/src/libstd/sort.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#[doc = "Sorting methods"];
22
import vec::len;
3-
import int::{eq, ord};
43

54
export le;
65
export merge_sort;
@@ -142,6 +141,7 @@ fn qsort3<T: copy>(compare_func_lt: le<T>, compare_func_eq: le<T>,
142141
qsort3::<T>(compare_func_lt, compare_func_eq, arr, i, right);
143142
}
144143

144+
// FIXME: This should take lt and eq types (#2348)
145145
#[doc = "
146146
Fancy quicksort. Sorts a mut vector in place.
147147
@@ -152,17 +152,22 @@ According to these slides this is the algorithm of choice for
152152
153153
This is an unstable sort.
154154
"]
155-
fn quick_sort3<T: copy ord eq>(arr: [mut T]) {
155+
fn quick_sort3<T: copy>(compare_func_lt: le<T>, compare_func_eq: le<T>,
156+
arr: [mut T]) {
156157
if len::<T>(arr) == 0u { ret; }
157-
qsort3::<T>({ |x, y| x.lt(y) }, { |x, y| x.eq(y) }, arr, 0,
158+
qsort3::<T>(compare_func_lt, compare_func_eq, arr, 0,
158159
(len::<T>(arr) as int) - 1);
159160
}
160161

161162
#[cfg(test)]
162163
mod test_qsort3 {
163164
fn check_sort(v1: [mut int], v2: [mut int]) {
164165
let len = vec::len::<int>(v1);
165-
quick_sort3::<int>(v1);
166+
fn lt(&&a: int, &&b: int) -> bool { ret a < b; }
167+
fn equal(&&a: int, &&b: int) -> bool { ret a == b; }
168+
let f1 = lt;
169+
let f2 = equal;
170+
quick_sort3::<int>(f1, f2, v1);
166171
let mut i = 0u;
167172
while i < len {
168173
log(debug, v2[i]);

branches/try/src/libsyntax/diagnostic.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,11 @@ impl codemap_handler of handler for handler_t {
8686
}
8787
fn has_errors() -> bool { self.err_count > 0u }
8888
fn abort_if_errors() {
89-
let s;
90-
alt self.err_count {
91-
0u { ret; }
92-
1u { s = "aborting due to previous error"; }
93-
_ { s = #fmt["aborting due to %u previous errors",
94-
self.err_count]; }
89+
if self.err_count > 0u {
90+
let s = #fmt["aborting due to %u previous errors",
91+
self.err_count];
92+
self.fatal(s);
9593
}
96-
self.fatal(s);
9794
}
9895
fn warn(msg: str) {
9996
self.emit(none, msg, warning);

branches/try/src/libsyntax/ext/qquote.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ fn finish<T: qq_helper>
212212
state = skip(str::char_len(repl));
213213
str2 += repl;
214214
}
215-
alt state {
215+
alt copy state {
216216
active {str::push_char(str2, ch);}
217217
skip(1u) {state = blank;}
218218
skip(sk) {state = skip (sk-1u);}

branches/try/src/libsyntax/parse/token.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,16 @@ fn is_lit(t: token::token) -> bool {
184184
}
185185
}
186186

187-
fn is_ident(t: token::token) -> bool {
187+
pure fn is_ident(t: token::token) -> bool {
188188
alt t { token::IDENT(_, _) { ret true; } _ { } }
189189
ret false;
190190
}
191191

192-
fn is_plain_ident(t: token::token) -> bool {
192+
pure fn is_plain_ident(t: token::token) -> bool {
193193
ret alt t { token::IDENT(_, false) { true } _ { false } };
194194
}
195195

196-
fn is_bar(t: token::token) -> bool {
196+
pure fn is_bar(t: token::token) -> bool {
197197
alt t { token::BINOP(token::OR) | token::OROR { true } _ { false } }
198198
}
199199

branches/try/src/rustc/driver/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ fn compile_upto(sess: session, cfg: ast::crate_cfg,
194194
bind middle::check_loop::check_crate(ty_cx, crate));
195195
time(time_passes, "alt checking",
196196
bind middle::check_alt::check_crate(ty_cx, crate));
197-
let last_use_map =
197+
let (last_use_map, spill_map) =
198198
time(time_passes, "liveness checking",
199199
bind middle::liveness::check_crate(ty_cx, method_map, crate));
200200
time(time_passes, "typestate checking",
@@ -216,7 +216,7 @@ fn compile_upto(sess: session, cfg: ast::crate_cfg,
216216
let maps = {mutbl_map: mutbl_map, root_map: root_map,
217217
copy_map: copy_map, last_use_map: last_use_map,
218218
impl_map: impl_map, method_map: method_map,
219-
vtable_map: vtable_map};
219+
vtable_map: vtable_map, spill_map: spill_map};
220220

221221
let (llmod, link_meta) =
222222
time(time_passes, "translation",

branches/try/src/rustc/driver/rustc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ import std::map::hashmap;
1515
import getopts::{opt_present};
1616
import rustc::driver::driver::*;
1717
import syntax::codemap;
18-
import syntax::diagnostic;
19-
import rustc::driver::session;
18+
import rustc::driver::{diagnostic, session};
2019
import rustc::middle::lint;
2120
import io::reader_util;
2221

branches/try/src/rustc/metadata/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import syntax::{ast, ast_util};
77
import syntax::attr;
88
import middle::ty;
99
import syntax::ast_map;
10+
import common::*;
1011
import tydecode::{parse_ty_data, parse_def_id, parse_bounds_data,
1112
parse_ident};
1213
import syntax::print::pprust;
1314
import cmd=cstore::crate_metadata;
1415
import util::ppaux::ty_to_str;
1516
import ebml::deserializer;
1617
import syntax::diagnostic::span_handler;
17-
import common::*;
1818

1919
export class_dtor;
2020
export get_class_fields;

0 commit comments

Comments
 (0)