Skip to content

Commit 0412da0

Browse files
---
yaml --- r: 64379 b: refs/heads/snap-stage3 c: 0cc7074 h: refs/heads/master i: 64377: 9022afb 64375: c8e08e3 v: v3
1 parent c4ebebf commit 0412da0

Some content is hidden

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

49 files changed

+370
-486
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: af54f633fd72dda691e70aef9aeadd36f0fab8b9
4+
refs/heads/snap-stage3: 0cc70743d2cf6edb782c1daa9b0f554484ed21eb
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

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.node.id));
425+
s, ~"block " + int::to_str(blk.id));
426426
}
427427
pprust::node_expr(s, expr) => {
428428
pp::space(s.s);

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

Lines changed: 5 additions & 4 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: fold::wrap(|a,b| fold_block(ctxt, a, b) ),
36+
fold_block: |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,21 +133,22 @@ 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,
151152
}
152153
}
153154

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

Lines changed: 5 additions & 4 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,19 +300,20 @@ 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
309+
rules: blk.rules,
310+
span: blk.span,
310311
};
311312
fold::noop_fold_block(&blk_sans_items, fld)
312313
}
313314

314315
let fld = fold::make_fold(@fold::AstFoldFns {
315-
fold_block: fold::wrap(drop_nested_items),
316+
fold_block: drop_nested_items,
316317
.. *fold::default_ast_fold()
317318
});
318319

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.node.id);
47+
debug!("check_loans(body id=%?)", body.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.node.id);
754+
this.check_for_conflicting_loans(blk.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.node.id,
84-
repeating_ids: ~[body.node.id],
83+
item_ub: body.id,
84+
repeating_ids: ~[body.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.node.id);
126+
this.push_repeating_id(body.id);
127127
visit::visit_fn(fk, decl, body, sp, id, (this, v));
128-
this.pop_repeating_id(body.node.id);
128+
this.pop_repeating_id(body.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.node.id);
137+
this.id_range.add(blk.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.node.id, ex.id)));
243+
this.gather_pat(cmt, *pat, Some((arm.body.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.node.id);
271+
this.push_repeating_id(body.id);
272272
(vt.visit_block)(body, (this, vt));
273-
this.pop_repeating_id(body.node.id);
273+
this.pop_repeating_id(body.id);
274274
}
275275

276276
// see explanation attached to the `root_ub` field:
277277
ast::expr_loop(ref body, _) => {
278-
this.push_repeating_id(body.node.id);
278+
this.push_repeating_id(body.id);
279279
visit::visit_expr(ex, (this, vt));
280-
this.pop_repeating_id(body.node.id);
280+
this.pop_repeating_id(body.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.node.id, // Arguments live only as long as the fn body.
626+
body.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.node.stmts.iter().advance |&stmt| {
56+
for blk.stmts.iter().advance |&stmt| {
5757
stmts_exit = self.stmt(stmt, stmts_exit);
5858
}
5959

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

62-
self.add_node(blk.node.id, [expr_exit])
62+
self.add_node(blk.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.node.id),
333+
pprust::node_block(ps, blk) => (ps, blk.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.node.id=%?, in_out=%s)",
387-
blk.node.id, bits_to_str(reslice(in_out)));
386+
debug!("DataFlowContext::walk_block(blk.id=%?, in_out=%s)",
387+
blk.id, bits_to_str(reslice(in_out)));
388388

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

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

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

397-
self.dfcx.apply_gen_kill(blk.node.id, in_out);
397+
self.dfcx.apply_gen_kill(blk.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.node.rules == unsafe_blk &&
102+
if block.rules == unsafe_blk &&
103103
context.unsafe_context == SafeContext {
104-
context.unsafe_context = UnsafeBlock(block.node.id)
104+
context.unsafe_context = UnsafeBlock(block.id)
105105
}
106106

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fn check_item(item: @item, (cx, visitor): (Context, visit::vt<Context>)) {
122122
None => cx.tcx.sess.bug("trait ref not in def map!"),
123123
Some(&trait_def) => {
124124
let trait_def_id = ast_util::def_id_of_def(trait_def);
125-
if cx.tcx.lang_items.drop_trait() == Some(trait_def_id) {
125+
if cx.tcx.lang_items.drop_trait() == trait_def_id {
126126
// Yes, it's a destructor.
127127
match self_type.node {
128128
ty_path(_, ref bounds, path_node_id) => {

0 commit comments

Comments
 (0)