Skip to content

Commit d3b861e

Browse files
committed
---
yaml --- r: 64380 b: refs/heads/snap-stage3 c: 827a6d2 h: refs/heads/master v: v3
1 parent 0412da0 commit d3b861e

Some content is hidden

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

54 files changed

+236
-245
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: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 0cc70743d2cf6edb782c1daa9b0f554484ed21eb
4+
refs/heads/snap-stage3: 827a6d26e62817e39a5b5a71f175557ca221670e
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/tutorial.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ supported build environments that are most likely to work.
8484
> know.
8585
8686
[bug-3319]: https://github.com/mozilla/rust/issues/3319
87-
[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
87+
[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
8888

8989
To build from source you will also need the following prerequisite
9090
packages:
@@ -118,7 +118,6 @@ API-documentation tool; `rustpkg`, the Rust package manager;
118118
`rusti`, the Rust REPL; and `rust`, a tool which acts both as a unified
119119
interface for them, and for a few common command line scenarios.
120120

121-
[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
122121
[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz
123122
[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe
124123

@@ -410,8 +409,6 @@ println(fmt!("what is this thing: %?", mystery_object));
410409

411410
You can define your own syntax extensions with the macro system. For details, see the [macro tutorial][macros].
412411

413-
[macros]: tutorial-macros.html
414-
415412
# Control structures
416413

417414
## Conditionals
@@ -1512,8 +1509,6 @@ closures, but they also own them: that is, no other code can access
15121509
them. Owned closures are used in concurrent code, particularly
15131510
for spawning [tasks][tasks].
15141511

1515-
[tasks]: tutorial-tasks.html
1516-
15171512
## Closure compatibility
15181513

15191514
Rust closures have a convenient subtyping property: you can pass any kind of
@@ -2534,9 +2529,4 @@ There is further documentation on the [wiki].
25342529
[ffi]: tutorial-ffi.html
25352530

25362531
[wiki]: https://github.com/mozilla/rust/wiki/Docs
2537-
[unit testing]: https://github.com/mozilla/rust/wiki/Doc-unit-testing
2538-
[rustdoc]: https://github.com/mozilla/rust/wiki/Doc-using-rustdoc
2539-
[cargo]: https://github.com/mozilla/rust/wiki/Doc-using-cargo-to-manage-packages
2540-
[attributes]: https://github.com/mozilla/rust/wiki/Doc-attributes
25412532

2542-
[pound-rust]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ impl<T> Deque<T> for DList<T> {
173173
let tail_own = match tail.prev.resolve() {
174174
None => {
175175
self.list_tail = Rawlink::none();
176-
self.list_head.take_unwrap()
176+
self.list_head.swap_unwrap()
177177
},
178178
Some(tail_prev) => {
179179
self.list_tail = tail.prev;
180-
tail_prev.next.take_unwrap()
180+
tail_prev.next.swap_unwrap()
181181
}
182182
};
183183
Some(tail_own.value)
@@ -465,7 +465,7 @@ impl<'self, A> ListInsertion<A> for MutDListIterator<'self, A> {
465465
Some(prev) => prev,
466466
};
467467
let mut ins_node = ~Node{value: elt, next: None, prev: Rawlink::none()};
468-
let node_own = prev_node.next.take_unwrap();
468+
let node_own = prev_node.next.swap_unwrap();
469469
ins_node.next = link_with_prev(node_own, Rawlink::some(ins_node));
470470
prev_node.next = link_with_prev(ins_node, Rawlink::some(prev_node));
471471
self.list.length += 1;

branches/snap-stage3/src/libextra/net/ip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub fn get_addr(node: &str, iotask: &iotask)
116116
let (output_po, output_ch) = stream();
117117
let mut output_ch = Some(SharedChan::new(output_ch));
118118
do str::as_buf(node) |node_ptr, len| {
119-
let output_ch = output_ch.take_unwrap();
119+
let output_ch = output_ch.swap_unwrap();
120120
debug!("slice len %?", len);
121121
let handle = create_uv_getaddrinfo_t();
122122
let handle_ptr: *uv_getaddrinfo_t = &handle;

branches/snap-stage3/src/libextra/sync.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ impl<'self> Condvar<'self> {
260260
signal_waitqueue(&state.waiters);
261261
}
262262
// Enqueue ourself to be woken up by a signaller.
263-
let SignalEnd = SignalEnd.take_unwrap();
263+
let SignalEnd = SignalEnd.swap_unwrap();
264264
state.blocked[condvar_id].tail.send(SignalEnd);
265265
} else {
266266
out_of_bounds = Some(state.blocked.len());
@@ -281,7 +281,7 @@ impl<'self> Condvar<'self> {
281281
// Unconditionally "block". (Might not actually block if a
282282
// signaller already sent -- I mean 'unconditionally' in contrast
283283
// with acquire().)
284-
let _ = comm::recv_one(WaitEnd.take_unwrap());
284+
let _ = comm::recv_one(WaitEnd.swap_unwrap());
285285
}
286286

287287
// This is needed for a failing condition variable to reacquire the
@@ -353,7 +353,7 @@ impl<'self> Condvar<'self> {
353353
}
354354
}
355355
do check_cvar_bounds(out_of_bounds, condvar_id, "cond.signal_on()") {
356-
let queue = queue.take_unwrap();
356+
let queue = queue.swap_unwrap();
357357
broadcast_waitqueue(&queue)
358358
}
359359
}
@@ -1436,7 +1436,7 @@ mod tests {
14361436
do x.write_downgrade |xwrite| {
14371437
let mut xopt = Some(xwrite);
14381438
do y.write_downgrade |_ywrite| {
1439-
y.downgrade(xopt.take_unwrap());
1439+
y.downgrade(xopt.swap_unwrap());
14401440
error!("oops, y.downgrade(x) should have failed!");
14411441
}
14421442
}

branches/snap-stage3/src/libextra/treemap.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ fn mutate_values<'r, K: TotalOrd, V>(node: &'r mut Option<~TreeNode<K, V>>,
552552
// Remove left horizontal link by rotating right
553553
fn skew<K: TotalOrd, V>(node: &mut ~TreeNode<K, V>) {
554554
if node.left.map_default(false, |x| x.level == node.level) {
555-
let mut save = node.left.take_unwrap();
555+
let mut save = node.left.swap_unwrap();
556556
swap(&mut node.left, &mut save.right); // save.right now None
557557
swap(node, &mut save);
558558
node.right = Some(save);
@@ -564,7 +564,7 @@ fn skew<K: TotalOrd, V>(node: &mut ~TreeNode<K, V>) {
564564
fn split<K: TotalOrd, V>(node: &mut ~TreeNode<K, V>) {
565565
if node.right.map_default(false,
566566
|x| x.right.map_default(false, |y| y.level == node.level)) {
567-
let mut save = node.right.take_unwrap();
567+
let mut save = node.right.swap_unwrap();
568568
swap(&mut node.right, &mut save.left); // save.left now None
569569
save.level += 1;
570570
swap(node, &mut save);
@@ -643,7 +643,7 @@ fn remove<K: TotalOrd, V>(node: &mut Option<~TreeNode<K, V>>,
643643
Equal => {
644644
if save.left.is_some() {
645645
if save.right.is_some() {
646-
let mut left = save.left.take_unwrap();
646+
let mut left = save.left.swap_unwrap();
647647
if left.right.is_some() {
648648
heir_swap(save, &mut left.right);
649649
} else {
@@ -653,13 +653,13 @@ fn remove<K: TotalOrd, V>(node: &mut Option<~TreeNode<K, V>>,
653653
save.left = Some(left);
654654
(remove(&mut save.left, key), true)
655655
} else {
656-
let new = save.left.take_unwrap();
656+
let new = save.left.swap_unwrap();
657657
let ~TreeNode{value, _} = replace(save, new);
658-
*save = save.left.take_unwrap();
658+
*save = save.left.swap_unwrap();
659659
(Some(value), true)
660660
}
661661
} else if save.right.is_some() {
662-
let new = save.right.take_unwrap();
662+
let new = save.right.swap_unwrap();
663663
let ~TreeNode{value, _} = replace(save, new);
664664
(Some(value), true)
665665
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ pub fn pretty_print_input(sess: Session, cfg: ast::crate_cfg, input: &input,
422422
pprust::node_block(s, ref blk) => {
423423
pp::space(s.s);
424424
pprust::synth_comment(
425-
s, ~"block " + int::to_str(blk.id));
425+
s, ~"block " + int::to_str(blk.node.id));
426426
}
427427
pprust::node_expr(s, expr) => {
428428
pp::space(s.s);

branches/snap-stage3/src/librustc/front/config.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn strip_items(crate: &ast::crate, in_cfg: in_cfg_pred)
3333

3434
let precursor = @fold::AstFoldFns {
3535
fold_mod: |a,b| fold_mod(ctxt, a, b),
36-
fold_block: |a,b| fold_block(ctxt, a, b),
36+
fold_block: fold::wrap(|a,b| fold_block(ctxt, a, b) ),
3737
fold_foreign_mod: |a,b| fold_foreign_mod(ctxt, a, b),
3838
fold_item_underscore: |a,b| {
3939
// Bad copy.
@@ -133,22 +133,21 @@ fn filter_stmt(cx: @Context, stmt: @ast::stmt) ->
133133

134134
fn fold_block(
135135
cx: @Context,
136-
b: &ast::blk,
136+
b: &ast::blk_,
137137
fld: @fold::ast_fold
138-
) -> ast::blk {
138+
) -> ast::blk_ {
139139
let resulting_stmts = do b.stmts.iter().filter_map |a| {
140140
filter_stmt(cx, *a).chain(|stmt| fld.fold_stmt(stmt))
141141
}.collect();
142142
let filtered_view_items = do b.view_items.iter().filter_map |a| {
143143
filter_view_item(cx, a).map(|&x| fld.fold_view_item(x))
144144
}.collect();
145-
ast::blk {
145+
ast::blk_ {
146146
view_items: filtered_view_items,
147147
stmts: resulting_stmts,
148148
expr: b.expr.map(|x| fld.fold_expr(*x)),
149149
id: b.id,
150150
rules: b.rules,
151-
span: b.span,
152151
}
153152
}
154153

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ fn encode_ast(ebml_w: &mut writer::Encoder, item: ast::inlined_item) {
289289
// nested items, as otherwise it would get confused when translating
290290
// inlined items.
291291
fn simplify_ast(ii: &ast::inlined_item) -> ast::inlined_item {
292-
fn drop_nested_items(blk: &ast::blk, fld: @fold::ast_fold) -> ast::blk {
292+
fn drop_nested_items(blk: &ast::blk_, fld: @fold::ast_fold) -> ast::blk_ {
293293
let stmts_sans_items = do blk.stmts.iter().filter_map |stmt| {
294294
match stmt.node {
295295
ast::stmt_expr(_, _) | ast::stmt_semi(_, _) |
@@ -300,20 +300,19 @@ fn simplify_ast(ii: &ast::inlined_item) -> ast::inlined_item {
300300
ast::stmt_mac(*) => fail!("unexpanded macro in astencode")
301301
}
302302
}.collect();
303-
let blk_sans_items = ast::blk {
303+
let blk_sans_items = ast::blk_ {
304304
view_items: ~[], // I don't know if we need the view_items here,
305305
// but it doesn't break tests!
306306
stmts: stmts_sans_items,
307307
expr: blk.expr,
308308
id: blk.id,
309-
rules: blk.rules,
310-
span: blk.span,
309+
rules: blk.rules
311310
};
312311
fold::noop_fold_block(&blk_sans_items, fld)
313312
}
314313

315314
let fld = fold::make_fold(@fold::AstFoldFns {
316-
fold_block: drop_nested_items,
315+
fold_block: fold::wrap(drop_nested_items),
317316
.. *fold::default_ast_fold()
318317
});
319318

branches/snap-stage3/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub fn check_loans(bccx: @BorrowckCtxt,
4444
move_data: move_data::FlowedMoveData,
4545
all_loans: &[Loan],
4646
body: &ast::blk) {
47-
debug!("check_loans(body id=%?)", body.id);
47+
debug!("check_loans(body id=%?)", body.node.id);
4848

4949
let clcx = @mut CheckLoanCtxt {
5050
bccx: bccx,
@@ -751,5 +751,5 @@ fn check_loans_in_block<'a>(blk: &ast::blk,
751751
visit::vt<@mut CheckLoanCtxt<'a>>))
752752
{
753753
visit::visit_block(blk, (this, vt));
754-
this.check_for_conflicting_loans(blk.id);
754+
this.check_for_conflicting_loans(blk.node.id);
755755
}

branches/snap-stage3/src/librustc/middle/borrowck/gather_loans/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ pub fn gather_loans(bccx: @BorrowckCtxt,
8080
bccx: bccx,
8181
id_range: id_range::max(),
8282
all_loans: @mut ~[],
83-
item_ub: body.id,
84-
repeating_ids: ~[body.id],
83+
item_ub: body.node.id,
84+
repeating_ids: ~[body.node.id],
8585
move_data: @mut MoveData::new()
8686
};
8787
glcx.gather_fn_arg_patterns(decl, body);
@@ -123,9 +123,9 @@ fn gather_loans_in_fn(fk: &visit::fn_kind,
123123

124124
// Visit closures as part of the containing item.
125125
&visit::fk_anon(*) | &visit::fk_fn_block(*) => {
126-
this.push_repeating_id(body.id);
126+
this.push_repeating_id(body.node.id);
127127
visit::visit_fn(fk, decl, body, sp, id, (this, v));
128-
this.pop_repeating_id(body.id);
128+
this.pop_repeating_id(body.node.id);
129129
this.gather_fn_arg_patterns(decl, body);
130130
}
131131
}
@@ -134,7 +134,7 @@ fn gather_loans_in_fn(fk: &visit::fn_kind,
134134
fn gather_loans_in_block(blk: &ast::blk,
135135
(this, vt): (@mut GatherLoanCtxt,
136136
visit::vt<@mut GatherLoanCtxt>)) {
137-
this.id_range.add(blk.id);
137+
this.id_range.add(blk.node.id);
138138
visit::visit_block(blk, (this, vt));
139139
}
140140

@@ -240,7 +240,7 @@ fn gather_loans_in_expr(ex: @ast::expr,
240240
let cmt = this.bccx.cat_expr(ex_v);
241241
for arms.iter().advance |arm| {
242242
for arm.pats.iter().advance |pat| {
243-
this.gather_pat(cmt, *pat, Some((arm.body.id, ex.id)));
243+
this.gather_pat(cmt, *pat, Some((arm.body.node.id, ex.id)));
244244
}
245245
}
246246
visit::visit_expr(ex, (this, vt));
@@ -268,16 +268,16 @@ fn gather_loans_in_expr(ex: @ast::expr,
268268
this.pop_repeating_id(cond.id);
269269

270270
// during body, can only root for the body
271-
this.push_repeating_id(body.id);
271+
this.push_repeating_id(body.node.id);
272272
(vt.visit_block)(body, (this, vt));
273-
this.pop_repeating_id(body.id);
273+
this.pop_repeating_id(body.node.id);
274274
}
275275

276276
// see explanation attached to the `root_ub` field:
277277
ast::expr_loop(ref body, _) => {
278-
this.push_repeating_id(body.id);
278+
this.push_repeating_id(body.node.id);
279279
visit::visit_expr(ex, (this, vt));
280-
this.pop_repeating_id(body.id);
280+
this.pop_repeating_id(body.node.id);
281281
}
282282

283283
ast::expr_fn_block(*) => {
@@ -623,7 +623,7 @@ impl GatherLoanCtxt {
623623
let arg_cmt = mc_ctxt.cat_rvalue(
624624
arg.id,
625625
arg.pat.span,
626-
body.id, // Arguments live only as long as the fn body.
626+
body.node.id, // Arguments live only as long as the fn body.
627627
arg_ty);
628628

629629
self.gather_pat(arg_cmt, arg.pat, None);

branches/snap-stage3/src/librustc/middle/cfg/construct.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ pub fn construct(tcx: ty::ctxt,
5353
impl CFGBuilder {
5454
fn block(&mut self, blk: &ast::blk, pred: CFGIndex) -> CFGIndex {
5555
let mut stmts_exit = pred;
56-
for blk.stmts.iter().advance |&stmt| {
56+
for blk.node.stmts.iter().advance |&stmt| {
5757
stmts_exit = self.stmt(stmt, stmts_exit);
5858
}
5959

60-
let expr_exit = self.opt_expr(blk.expr, stmts_exit);
60+
let expr_exit = self.opt_expr(blk.node.expr, stmts_exit);
6161

62-
self.add_node(blk.id, [expr_exit])
62+
self.add_node(blk.node.id, [expr_exit])
6363
}
6464

6565
fn stmt(&mut self, stmt: @ast::stmt, pred: CFGIndex) -> CFGIndex {

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ impl<O:DataFlowOperator+Copy+'static> DataFlowContext<O> {
330330
let pre: @fn(pprust::ann_node) = |node| {
331331
let (ps, id) = match node {
332332
pprust::node_expr(ps, expr) => (ps, expr.id),
333-
pprust::node_block(ps, blk) => (ps, blk.id),
333+
pprust::node_block(ps, blk) => (ps, blk.node.id),
334334
pprust::node_item(ps, _) => (ps, 0),
335335
pprust::node_pat(ps, pat) => (ps, pat.id)
336336
};
@@ -383,18 +383,18 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
383383
blk: &ast::blk,
384384
in_out: &mut [uint],
385385
loop_scopes: &mut ~[LoopScope]) {
386-
debug!("DataFlowContext::walk_block(blk.id=%?, in_out=%s)",
387-
blk.id, bits_to_str(reslice(in_out)));
386+
debug!("DataFlowContext::walk_block(blk.node.id=%?, in_out=%s)",
387+
blk.node.id, bits_to_str(reslice(in_out)));
388388

389-
self.merge_with_entry_set(blk.id, in_out);
389+
self.merge_with_entry_set(blk.node.id, in_out);
390390

391-
for blk.stmts.iter().advance |&stmt| {
391+
for blk.node.stmts.iter().advance |&stmt| {
392392
self.walk_stmt(stmt, in_out, loop_scopes);
393393
}
394394

395-
self.walk_opt_expr(blk.expr, in_out, loop_scopes);
395+
self.walk_opt_expr(blk.node.expr, in_out, loop_scopes);
396396

397-
self.dfcx.apply_gen_kill(blk.id, in_out);
397+
self.dfcx.apply_gen_kill(blk.node.id, in_out);
398398
}
399399

400400
fn walk_stmt(&mut self,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ pub fn check_crate(tcx: ty::ctxt,
9999

100100
visit_block: |block, (_, visitor)| {
101101
let old_unsafe_context = context.unsafe_context;
102-
if block.rules == unsafe_blk &&
102+
if block.node.rules == unsafe_blk &&
103103
context.unsafe_context == SafeContext {
104-
context.unsafe_context = UnsafeBlock(block.id)
104+
context.unsafe_context = UnsafeBlock(block.node.id)
105105
}
106106

107107
visit::visit_block(block, ((), visitor));

0 commit comments

Comments
 (0)