Skip to content

Commit ba5d787

Browse files
committed
---
yaml --- r: 31049 b: refs/heads/incoming c: ca49fd4 h: refs/heads/master i: 31047: ff1ea39 v: v3
1 parent 4260126 commit ba5d787

File tree

24 files changed

+94
-98
lines changed

24 files changed

+94
-98
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: e16dbb7888504ef5d0de0c14493fc8ecc492ee30
9+
refs/heads/incoming: ca49fd402af8e7bf613c43e996274b5a017958d2
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/cmath.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ pub extern mod c_double {
4040
#[link_name="fmax"] pure fn fmax(a: c_double, b: c_double) -> c_double;
4141
#[link_name="fmin"] pure fn fmin(a: c_double, b: c_double) -> c_double;
4242
pure fn nextafter(x: c_double, y: c_double) -> c_double;
43-
pure fn frexp(n: c_double, &value: c_int) -> c_double;
43+
pure fn frexp(n: c_double, value: &mut c_int) -> c_double;
4444
pure fn hypot(x: c_double, y: c_double) -> c_double;
4545
pure fn ldexp(x: c_double, n: c_int) -> c_double;
4646
#[cfg(unix)]
4747
#[link_name="lgamma_r"] pure fn lgamma(n: c_double,
48-
&sign: c_int) -> c_double;
48+
sign: &mut c_int) -> c_double;
4949
#[cfg(windows)]
5050
#[link_name="__lgamma_r"] pure fn lgamma(n: c_double,
51-
&sign: c_int) -> c_double;
51+
sign: &mut c_int) -> c_double;
5252
// renamed: log is a reserved keyword; ln seems more natural, too
5353
#[link_name="log"] pure fn ln(n: c_double) -> c_double;
5454
// renamed: "logb" /often/ is confused for log2 by beginners
@@ -58,7 +58,7 @@ pub extern mod c_double {
5858
pure fn log10(n: c_double) -> c_double;
5959
pure fn log2(n: c_double) -> c_double;
6060
#[link_name="ilogb"] pure fn ilog_radix(n: c_double) -> c_int;
61-
pure fn modf(n: c_double, &iptr: c_double) -> c_double;
61+
pure fn modf(n: c_double, iptr: &mut c_double) -> c_double;
6262
pure fn pow(n: c_double, e: c_double) -> c_double;
6363
// FIXME (#1379): enable when rounding modes become available
6464
// pure fn rint(n: c_double) -> c_double;
@@ -110,7 +110,7 @@ pub extern mod c_float {
110110
#[link_name="fdimf"] pure fn abs_sub(a: c_float, b: c_float) -> c_float;
111111
#[link_name="floorf"] pure fn floor(n: c_float) -> c_float;
112112
#[link_name="frexpf"] pure fn frexp(n: c_float,
113-
&value: c_int) -> c_float;
113+
value: &mut c_int) -> c_float;
114114
#[link_name="fmaf"] pure fn mul_add(a: c_float,
115115
b: c_float, c: c_float) -> c_float;
116116
#[link_name="fmaxf"] pure fn fmax(a: c_float, b: c_float) -> c_float;
@@ -122,11 +122,11 @@ pub extern mod c_float {
122122

123123
#[cfg(unix)]
124124
#[link_name="lgammaf_r"] pure fn lgamma(n: c_float,
125-
&sign: c_int) -> c_float;
125+
sign: &mut c_int) -> c_float;
126126

127127
#[cfg(windows)]
128128
#[link_name="__lgammaf_r"] pure fn lgamma(n: c_float,
129-
&sign: c_int) -> c_float;
129+
sign: &mut c_int) -> c_float;
130130

131131
#[link_name="logf"] pure fn ln(n: c_float) -> c_float;
132132
#[link_name="logbf"] pure fn log_radix(n: c_float) -> c_float;
@@ -135,7 +135,7 @@ pub extern mod c_float {
135135
#[link_name="log10f"] pure fn log10(n: c_float) -> c_float;
136136
#[link_name="ilogbf"] pure fn ilog_radix(n: c_float) -> c_int;
137137
#[link_name="modff"] pure fn modf(n: c_float,
138-
&iptr: c_float) -> c_float;
138+
iptr: &mut c_float) -> c_float;
139139
#[link_name="powf"] pure fn pow(n: c_float, e: c_float) -> c_float;
140140
// FIXME (#1379): enable when rounding modes become available
141141
// #[link_name="rintf"] pure fn rint(n: c_float) -> c_float;

branches/incoming/src/libstd/time.rs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,18 @@ use result::{Result, Ok, Err};
77

88
#[abi = "cdecl"]
99
extern mod rustrt {
10-
#[legacy_exports];
10+
#[legacy_exports]
11+
#[cfg(stage0)]
1112
fn get_time(&sec: i64, &nsec: i32);
13+
#[cfg(stage1)]
14+
#[cfg(stage2)]
15+
fn get_time(sec: &mut i64, nsec: &mut i32);
16+
17+
#[cfg(stage0)]
1218
fn precise_time_ns(&ns: u64);
19+
#[cfg(stage1)]
20+
#[cfg(stage2)]
21+
fn precise_time_ns(ns: &mut u64);
1322

1423
fn rust_tzset();
1524
// FIXME: The i64 values can be passed by-val when #2064 is fixed.
@@ -33,22 +42,41 @@ impl Timespec : Eq {
3342
* Returns the current time as a `timespec` containing the seconds and
3443
* nanoseconds since 1970-01-01T00:00:00Z.
3544
*/
45+
#[cfg(stage0)]
3646
pub fn get_time() -> Timespec {
3747
let mut sec = 0i64;
3848
let mut nsec = 0i32;
3949
rustrt::get_time(sec, nsec);
4050
return {sec: sec, nsec: nsec};
4151
}
52+
#[cfg(stage1)]
53+
#[cfg(stage2)]
54+
pub fn get_time() -> Timespec {
55+
let mut sec = 0i64;
56+
let mut nsec = 0i32;
57+
rustrt::get_time(&mut sec, &mut nsec);
58+
return {sec: sec, nsec: nsec};
59+
}
60+
4261

4362
/**
4463
* Returns the current value of a high-resolution performance counter
4564
* in nanoseconds since an unspecified epoch.
4665
*/
66+
#[cfg(stage0)]
4767
pub fn precise_time_ns() -> u64 {
4868
let mut ns = 0u64;
4969
rustrt::precise_time_ns(ns);
5070
ns
5171
}
72+
#[cfg(stage1)]
73+
#[cfg(stage2)]
74+
pub fn precise_time_ns() -> u64 {
75+
let mut ns = 0u64;
76+
rustrt::precise_time_ns(&mut ns);
77+
ns
78+
}
79+
5280

5381
/**
5482
* Returns the current value of a high-resolution performance counter

branches/incoming/src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ impl<T:cmp::Eq> inferable<T> : cmp::Eq {
574574

575575
// "resolved" mode: the real modes.
576576
#[auto_serialize]
577-
enum rmode { by_ref, by_val, by_mutbl_ref, by_move, by_copy }
577+
enum rmode { by_ref, by_val, by_move, by_copy }
578578

579579
impl rmode : to_bytes::IterBytes {
580580
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {

branches/incoming/src/libsyntax/parse/comments.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ fn consume_non_eol_whitespace(rdr: string_reader) {
127127
}
128128
}
129129
130-
fn push_blank_line_comment(rdr: string_reader, &comments: ~[cmnt]) {
130+
fn push_blank_line_comment(rdr: string_reader, comments: &mut ~[cmnt]) {
131131
debug!(">>> blank-line comment");
132132
let v: ~[~str] = ~[];
133133
comments.push({style: blank_line, lines: v, pos: rdr.chpos});
134134
}
135135
136136
fn consume_whitespace_counting_blank_lines(rdr: string_reader,
137-
&comments: ~[cmnt]) {
137+
comments: &mut ~[cmnt]) {
138138
while is_whitespace(rdr.curr) && !is_eof(rdr) {
139139
if rdr.col == 0u && rdr.curr == '\n' {
140140
push_blank_line_comment(rdr, comments);
@@ -145,7 +145,7 @@ fn consume_whitespace_counting_blank_lines(rdr: string_reader,
145145
146146
147147
fn read_shebang_comment(rdr: string_reader, code_to_the_left: bool,
148-
&comments: ~[cmnt]) {
148+
comments: &mut ~[cmnt]) {
149149
debug!(">>> shebang comment");
150150
let p = rdr.chpos;
151151
debug!("<<< shebang comment");
@@ -157,7 +157,7 @@ fn read_shebang_comment(rdr: string_reader, code_to_the_left: bool,
157157
}
158158
159159
fn read_line_comments(rdr: string_reader, code_to_the_left: bool,
160-
&comments: ~[cmnt]) {
160+
comments: &mut ~[cmnt]) {
161161
debug!(">>> line comments");
162162
let p = rdr.chpos;
163163
let mut lines: ~[~str] = ~[];
@@ -188,8 +188,8 @@ fn all_whitespace(s: ~str, begin: uint, end: uint) -> bool {
188188
return true;
189189
}
190190
191-
fn trim_whitespace_prefix_and_push_line(&lines: ~[~str],
192-
s: ~str, col: uint) unsafe {
191+
fn trim_whitespace_prefix_and_push_line(lines: &mut ~[~str],
192+
s: ~str, col: uint) {
193193
let mut s1;
194194
let len = str::len(s);
195195
if all_whitespace(s, 0u, uint::min(len, col)) {
@@ -202,7 +202,7 @@ fn trim_whitespace_prefix_and_push_line(&lines: ~[~str],
202202
}
203203
204204
fn read_block_comment(rdr: string_reader, code_to_the_left: bool,
205-
&comments: ~[cmnt]) {
205+
comments: &mut ~[cmnt]) {
206206
debug!(">>> block comment");
207207
let p = rdr.chpos;
208208
let mut lines: ~[~str] = ~[];
@@ -228,7 +228,7 @@ fn read_block_comment(rdr: string_reader, code_to_the_left: bool,
228228
debug!("=== block comment level %d", level);
229229
if is_eof(rdr) {(rdr as reader).fatal(~"unterminated block comment");}
230230
if rdr.curr == '\n' {
231-
trim_whitespace_prefix_and_push_line(lines, curr_line, col);
231+
trim_whitespace_prefix_and_push_line(&mut lines, curr_line, col);
232232
curr_line = ~"";
233233
bump(rdr);
234234
} else {
@@ -248,8 +248,8 @@ fn read_block_comment(rdr: string_reader, code_to_the_left: bool,
248248
}
249249
}
250250
}
251-
if str::len(curr_line) != 0u {
252-
trim_whitespace_prefix_and_push_line(lines, curr_line, col);
251+
if str::len(curr_line) != 0 {
252+
trim_whitespace_prefix_and_push_line(&mut lines, curr_line, col);
253253
}
254254
let mut style = if code_to_the_left { trailing } else { isolated };
255255
consume_non_eol_whitespace(rdr);
@@ -267,7 +267,7 @@ fn peeking_at_comment(rdr: string_reader) -> bool {
267267
}
268268
269269
fn consume_comment(rdr: string_reader, code_to_the_left: bool,
270-
&comments: ~[cmnt]) {
270+
comments: &mut ~[cmnt]) {
271271
debug!(">>> consume comment");
272272
if rdr.curr == '/' && nextch(rdr) == '/' {
273273
read_line_comments(rdr, code_to_the_left, comments);
@@ -299,11 +299,11 @@ fn gather_comments_and_literals(span_diagnostic: diagnostic::span_handler,
299299
consume_non_eol_whitespace(rdr);
300300
if rdr.curr == '\n' {
301301
code_to_the_left = false;
302-
consume_whitespace_counting_blank_lines(rdr, comments);
302+
consume_whitespace_counting_blank_lines(rdr, &mut comments);
303303
}
304304
while peeking_at_comment(rdr) {
305-
consume_comment(rdr, code_to_the_left, comments);
306-
consume_whitespace_counting_blank_lines(rdr, comments);
305+
consume_comment(rdr, code_to_the_left, &mut comments);
306+
consume_whitespace_counting_blank_lines(rdr, &mut comments);
307307
}
308308
break;
309309
}

branches/incoming/src/libsyntax/parse/eval.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ type ctx =
1010
fn eval_crate_directives(cx: ctx,
1111
cdirs: ~[@ast::crate_directive],
1212
prefix: &Path,
13-
&view_items: ~[@ast::view_item],
14-
&items: ~[@ast::item]) {
13+
view_items: &mut~[@ast::view_item],
14+
items: &mut~[@ast::item]) {
1515
for cdirs.each |sub_cdir| {
1616
eval_crate_directive(cx, *sub_cdir, prefix, view_items, items);
1717
}
@@ -24,7 +24,7 @@ fn eval_crate_directives_to_mod(cx: ctx, cdirs: ~[@ast::crate_directive],
2424
= parse_companion_mod(cx, prefix, suffix);
2525
let mut view_items: ~[@ast::view_item] = ~[];
2626
let mut items: ~[@ast::item] = ~[];
27-
eval_crate_directives(cx, cdirs, prefix, view_items, items);
27+
eval_crate_directives(cx, cdirs, prefix, &mut view_items, &mut items);
2828
return ({view_items: vec::append(view_items, cview_items),
2929
items: vec::append(items, citems)},
3030
cattrs);
@@ -82,8 +82,8 @@ fn cdir_path_opt(default: ~str, attrs: ~[ast::attribute]) -> ~str {
8282
}
8383

8484
fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: &Path,
85-
&view_items: ~[@ast::view_item],
86-
&items: ~[@ast::item]) {
85+
view_items: &mut ~[@ast::view_item],
86+
items: &mut ~[@ast::item]) {
8787
match cdir.node {
8888
ast::cdir_src_mod(vis, id, attrs) => {
8989
let file_path = Path(cdir_path_opt(

branches/incoming/src/libsyntax/parse/parser.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use ast::{_mod, add, alt_check, alt_exhaustive, arg, arm, attribute,
2626
bind_by_ref, bind_by_implicit_ref, bind_by_value, bind_by_move,
2727
bitand, bitor, bitxor, blk, blk_check_mode, bound_const,
2828
bound_copy, bound_send, bound_trait, bound_owned, box, by_copy,
29-
by_move, by_mutbl_ref, by_ref, by_val, capture_clause,
29+
by_move, by_ref, by_val, capture_clause,
3030
capture_item, cdir_dir_mod, cdir_src_mod, cdir_view_item,
3131
class_immutable, class_mutable,
3232
crate, crate_cfg, crate_directive, decl, decl_item, decl_local,
@@ -571,7 +571,7 @@ impl parser {
571571
fn parse_arg_mode() -> mode {
572572
if self.eat(token::BINOP(token::AND)) {
573573
self.warn(~"Obsolete syntax has no effect");
574-
expl(by_mutbl_ref)
574+
expl(by_val)
575575
} else if self.eat(token::BINOP(token::MINUS)) {
576576
expl(by_move)
577577
} else if self.eat(token::ANDAND) {
@@ -1276,7 +1276,8 @@ impl parser {
12761276

12771277
return match self.token {
12781278
token::LPAREN | token::LBRACE | token::LBRACKET => {
1279-
let ket = token::flip_delimiter(self.token);
1279+
// tjc: ??????
1280+
let ket = token::flip_delimiter(copy self.token);
12801281
tt_delim(vec::append(
12811282
~[parse_tt_tok(self, true)],
12821283
vec::append(
@@ -1297,7 +1298,8 @@ impl parser {
12971298
return match self.token {
12981299
token::LBRACE | token::LPAREN | token::LBRACKET => {
12991300
self.parse_matcher_subseq(name_idx, copy self.token,
1300-
token::flip_delimiter(self.token))
1301+
// tjc: not sure why we need a copy
1302+
token::flip_delimiter(copy self.token))
13011303
}
13021304
_ => self.fatal(~"expected open delimiter")
13031305
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ pure fn can_begin_expr(t: token) -> bool {
230230
}
231231

232232
/// what's the opposite delimiter?
233-
fn flip_delimiter(&t: token::token) -> token::token {
233+
fn flip_delimiter(t: token::token) -> token::token {
234234
match t {
235235
token::LPAREN => token::RPAREN,
236236
token::LBRACE => token::RBRACE,

branches/incoming/src/libsyntax/print/pprust.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,6 @@ fn print_fn_block_args(s: ps, decl: ast::fn_decl,
16881688
16891689
fn mode_to_str(m: ast::mode) -> ~str {
16901690
match m {
1691-
ast::expl(ast::by_mutbl_ref) => ~"&",
16921691
ast::expl(ast::by_move) => ~"-",
16931692
ast::expl(ast::by_ref) => ~"&&",
16941693
ast::expl(ast::by_val) => ~"++",

branches/incoming/src/rustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fn encode_mutability(ebml_w: ebml::Writer, mt: class_mutability) {
116116
type entry<T> = {val: T, pos: uint};
117117

118118
fn add_to_index(ecx: @encode_ctxt, ebml_w: ebml::Writer, path: &[ident],
119-
&index: ~[entry<~str>], name: ident) {
119+
index: &mut ~[entry<~str>], name: ident) {
120120
let mut full_path = ~[];
121121
full_path.push_all(path);
122122
full_path.push(name);

branches/incoming/src/rustc/metadata/tydecode.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ fn parse_arg(st: @pstate, conv: conv_did) -> ty::arg {
394394

395395
fn parse_mode(st: @pstate) -> ast::mode {
396396
let m = ast::expl(match next(st) {
397-
'&' => ast::by_mutbl_ref,
398397
'-' => ast::by_move,
399398
'+' => ast::by_copy,
400399
'=' => ast::by_ref,

branches/incoming/src/rustc/metadata/tyencode.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ fn enc_arg(w: io::Writer, cx: @ctxt, arg: ty::arg) {
332332

333333
fn enc_mode(w: io::Writer, cx: @ctxt, m: mode) {
334334
match ty::resolved_mode(cx.tcx, m) {
335-
by_mutbl_ref => w.write_char('&'),
336335
by_move => w.write_char('-'),
337336
by_copy => w.write_char('+'),
338337
by_ref => w.write_char('='),

branches/incoming/src/rustc/middle/borrowck.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,10 @@ type req_maps = {
396396
pure_map: HashMap<ast::node_id, bckerr>
397397
};
398398

399-
fn save_and_restore<T:Copy,U>(&save_and_restore_t: T, f: fn() -> U) -> U {
400-
let old_save_and_restore_t = save_and_restore_t;
399+
fn save_and_restore<T:Copy,U>(save_and_restore_t: &mut T, f: fn() -> U) -> U {
400+
let old_save_and_restore_t = *save_and_restore_t;
401401
let u <- f();
402-
save_and_restore_t = old_save_and_restore_t;
402+
*save_and_restore_t = old_save_and_restore_t;
403403
move u
404404
}
405405

branches/incoming/src/rustc/middle/borrowck/check_loans.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,7 @@ impl check_loan_ctxt {
529529
ast::by_move => {
530530
self.check_move_out(*arg);
531531
}
532-
ast::by_mutbl_ref | ast::by_ref |
533-
ast::by_copy | ast::by_val => {
532+
ast::by_ref | ast::by_copy | ast::by_val => {
534533
}
535534
}
536535
}
@@ -542,9 +541,9 @@ fn check_loans_in_fn(fk: visit::fn_kind, decl: ast::fn_decl, body: ast::blk,
542541
visitor: visit::vt<check_loan_ctxt>) {
543542

544543
debug!("purity on entry=%?", copy self.declared_purity);
545-
do save_and_restore(self.in_ctor) {
546-
do save_and_restore(self.declared_purity) {
547-
do save_and_restore(self.fn_args) {
544+
do save_and_restore(&mut(self.in_ctor)) {
545+
do save_and_restore(&mut(self.declared_purity)) {
546+
do save_and_restore(&mut(self.fn_args)) {
548547
let is_stack_closure = self.is_stack_closure(id);
549548
let fty = ty::node_id_to_type(self.tcx(), id);
550549
self.declared_purity = ty::determine_inherited_purity(
@@ -667,7 +666,7 @@ fn check_loans_in_expr(expr: @ast::expr,
667666
fn check_loans_in_block(blk: ast::blk,
668667
&&self: check_loan_ctxt,
669668
vt: visit::vt<check_loan_ctxt>) {
670-
do save_and_restore(self.declared_purity) {
669+
do save_and_restore(&mut(self.declared_purity)) {
671670
self.check_for_conflicting_loans(blk.node.id);
672671

673672
match blk.node.rules {

0 commit comments

Comments
 (0)