Skip to content

Commit d1fb349

Browse files
committed
---
yaml --- r: 38367 b: refs/heads/try c: 2b92962 h: refs/heads/master i: 38365: 58036ea 38363: 90f4e3a 38359: 0af919d 38351: d47bd7d 38335: d7f8413 v: v3
1 parent 3c75d9f commit d1fb349

Some content is hidden

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

88 files changed

+1643
-1662
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: 11a307294a83c2651405137763c9d620ab3fc7e7
5+
refs/heads/try: 2b92962aa29b0116015f99c1666ecf6288303c65
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/src/compiletest/compiletest.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ fn is_test(config: config, testfile: &Path) -> bool {
211211

212212
fn make_test(config: config, testfile: &Path) ->
213213
test::TestDesc {
214-
{
214+
test::TestDesc {
215215
name: make_test_name(config, testfile),
216216
testfn: make_test_closure(config, testfile),
217217
ignore: header::is_test_ignored(config, testfile),

branches/try/src/libcargo/cargo.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ fn load_crate(filename: &Path) -> Option<Crate> {
403403
let e = @{
404404
mut deps: ~[]
405405
};
406-
let v = visit::mk_simple_visitor(@{
406+
let v = visit::mk_simple_visitor(@visit::SimpleVisitor {
407407
visit_view_item: |a| goto_view_item(sess, e, a),
408408
visit_item: |a| goto_item(e, a),
409409
.. *visit::default_simple_visitor()

branches/try/src/libcore/stackwalk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,5 @@ extern mod rustrt {
9999
#[abi = "rust-intrinsic"]
100100
extern mod rusti {
101101
#[legacy_exports];
102-
fn frame_address(f: fn(++x: *u8));
102+
fn frame_address(f: &once fn(++x: *u8));
103103
}

branches/try/src/libfuzzer/fuzzer.rc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ type stolen_stuff = {exprs: ~[ast::expr], tys: ~[ast::Ty]};
167167
fn steal(crate: ast::crate, tm: test_mode) -> stolen_stuff {
168168
let exprs = @mut ~[];
169169
let tys = @mut ~[];
170-
let v = visit::mk_simple_visitor(@{
170+
let v = visit::mk_simple_visitor(@visit::SimpleVisitor {
171171
visit_expr: |a| stash_expr_if(safe_to_steal_expr, exprs, a, tm),
172172
visit_ty: |a| stash_ty_if(safe_to_steal_ty, tys, a, tm),
173173
.. *visit::default_simple_visitor()
@@ -216,7 +216,7 @@ fn replace_expr_in_crate(crate: ast::crate, i: uint,
216216
fold::noop_fold_expr(original, fld)
217217
}
218218
}
219-
let afp = @{
219+
let afp = @fold::AstFoldFns {
220220
fold_expr: fold::wrap(|a,b| {
221221
fold_expr_rep(j, i, newexpr.node, a, b, tm)
222222
}),
@@ -241,7 +241,7 @@ fn replace_ty_in_crate(crate: ast::crate, i: uint, newty: ast::Ty,
241241
newty_
242242
} else { fold::noop_fold_ty(original, fld) }
243243
}
244-
let afp = @{
244+
let afp = @fold::AstFoldFns {
245245
fold_ty: fold::wrap(|a,b| fold_ty_rep(j, i, newty.node, a, b, tm) ),
246246
.. *fold::default_ast_fold()
247247
};
@@ -486,8 +486,9 @@ fn has_raw_pointers(c: ast::crate) -> bool {
486486
}
487487
}
488488
let v =
489-
visit::mk_simple_visitor(@{visit_ty: |a| visit_ty(has_rp, a),
490-
.. *visit::default_simple_visitor()});
489+
visit::mk_simple_visitor(@visit::SimpleVisitor {
490+
visit_ty: |a| visit_ty(has_rp, a),
491+
.. *visit::default_simple_visitor()});
491492
visit::visit_crate(c, (), v);
492493
return *has_rp;
493494
}

branches/try/src/librustc/driver/driver.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,16 @@ fn pretty_print_input(sess: Session, +cfg: ast::crate_cfg, input: input,
395395
396396
let ann = match ppm {
397397
ppm_typed => {
398-
{pre: ann_paren_for_expr,
399-
post: |a| ann_typed_post(tcx.get(), a) }
398+
pprust::pp_ann {pre: ann_paren_for_expr,
399+
post: |a| ann_typed_post(tcx.get(), a) }
400400
}
401401
ppm_identified | ppm_expanded_identified => {
402-
{pre: ann_paren_for_expr, post: ann_identified_post}
402+
pprust::pp_ann {pre: ann_paren_for_expr,
403+
post: ann_identified_post}
404+
}
405+
ppm_expanded | ppm_normal => {
406+
pprust::no_ann()
403407
}
404-
ppm_expanded | ppm_normal => pprust::no_ann()
405408
};
406409
let is_expanded = upto != cu_parse;
407410
let src = sess.codemap.get_filemap(source_name(input)).src;

branches/try/src/librustc/front/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ fn strip_items(crate: @ast::crate, in_cfg: in_cfg_pred)
3838

3939
let ctxt = @{in_cfg: in_cfg};
4040

41-
let precursor =
42-
@{fold_mod: |a,b| fold_mod(ctxt, a, b),
41+
let precursor = @fold::AstFoldFns {
42+
fold_mod: |a,b| fold_mod(ctxt, a, b),
4343
fold_block: fold::wrap(|a,b| fold_block(ctxt, a, b) ),
4444
fold_foreign_mod: |a,b| fold_foreign_mod(ctxt, a, b),
4545
fold_item_underscore: |a,b| {

branches/try/src/librustc/front/core_inject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn inject_libcore_ref(sess: Session,
4242
ast::spanned { node: x, span: dummy_sp() }
4343
}
4444

45-
let precursor = @{
45+
let precursor = @fold::AstFoldFns {
4646
fold_crate: |crate, span, fld| {
4747
let n1 = sess.next_node_id();
4848
let vi1 = @{node: ast::view_item_use(sess.ident_of(~"core"),

branches/try/src/librustc/front/test.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ fn generate_test_harness(sess: session::Session,
6565
mut path: ~[],
6666
testfns: DVec()};
6767

68-
let precursor =
69-
@{fold_crate: fold::wrap(|a,b| fold_crate(cx, a, b) ),
70-
fold_item: |a,b| fold_item(cx, a, b),
71-
fold_mod: |a,b| fold_mod(cx, a, b),.. *fold::default_ast_fold()};
68+
let precursor = @fold::AstFoldFns {
69+
fold_crate: fold::wrap(|a,b| fold_crate(cx, a, b) ),
70+
fold_item: |a,b| fold_item(cx, a, b),
71+
fold_mod: |a,b| fold_mod(cx, a, b),.. *fold::default_ast_fold()};
7272

7373
let fold = fold::make_fold(precursor);
7474
let res = @fold.fold_crate(*crate);
@@ -424,8 +424,14 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr {
424424
ident: cx.sess.ident_of(~"should_fail"),
425425
expr: @fail_expr});
426426

427+
let test_desc_path =
428+
mk_path(cx, ~[cx.sess.ident_of(~"test"),
429+
cx.sess.ident_of(~"TestDesc")]);
430+
427431
let desc_rec_: ast::expr_ =
428-
ast::expr_rec(~[name_field, fn_field, ignore_field, fail_field],
432+
ast::expr_struct(
433+
test_desc_path,
434+
~[name_field, fn_field, ignore_field, fail_field],
429435
option::None);
430436
let desc_rec: ast::expr =
431437
{id: cx.sess.next_node_id(), callee_id: cx.sess.next_node_id(),

branches/try/src/librustc/metadata/creader.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ fn read_crates(diag: span_handler,
5252
mut next_crate_num: 1,
5353
intr: intr};
5454
let v =
55-
visit::mk_simple_visitor(@{visit_view_item:
56-
|a| visit_view_item(e, a),
57-
visit_item: |a| visit_item(e, a)
58-
,.. *visit::default_simple_visitor()});
55+
visit::mk_simple_visitor(@visit::SimpleVisitor {
56+
visit_view_item: |a| visit_view_item(e, a),
57+
visit_item: |a| visit_item(e, a),
58+
.. *visit::default_simple_visitor()});
5959
visit::visit_crate(crate, (), v);
6060
dump_crates(e.crate_cache);
6161
warn_if_multiple_versions(e, diag, e.crate_cache.get());

branches/try/src/librustc/metadata/encoder.rs

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@ fn def_to_str(did: def_id) -> ~str { fmt!("%d:%d", did.crate, did.node) }
180180

181181
fn encode_ty_type_param_bounds(ebml_w: writer::Encoder, ecx: @encode_ctxt,
182182
params: @~[ty::param_bounds]) {
183-
let ty_str_ctxt = @{diag: ecx.diag,
184-
ds: def_to_str,
185-
tcx: ecx.tcx,
186-
reachable: |a| reachable(ecx, a),
187-
abbrevs: tyencode::ac_use_abbrevs(ecx.type_abbrevs)};
183+
let ty_str_ctxt = @tyencode::ctxt {
184+
diag: ecx.diag,
185+
ds: def_to_str,
186+
tcx: ecx.tcx,
187+
reachable: |a| reachable(ecx, a),
188+
abbrevs: tyencode::ac_use_abbrevs(ecx.type_abbrevs)};
188189
for params.each |param| {
189190
ebml_w.start_tag(tag_items_data_item_ty_param_bounds);
190191
tyencode::enc_bounds(ebml_w.writer, ty_str_ctxt, *param);
@@ -207,23 +208,23 @@ fn encode_variant_id(ebml_w: writer::Encoder, vid: def_id) {
207208
}
208209

209210
fn write_type(ecx: @encode_ctxt, ebml_w: writer::Encoder, typ: ty::t) {
210-
let ty_str_ctxt =
211-
@{diag: ecx.diag,
212-
ds: def_to_str,
213-
tcx: ecx.tcx,
214-
reachable: |a| reachable(ecx, a),
215-
abbrevs: tyencode::ac_use_abbrevs(ecx.type_abbrevs)};
211+
let ty_str_ctxt = @tyencode::ctxt {
212+
diag: ecx.diag,
213+
ds: def_to_str,
214+
tcx: ecx.tcx,
215+
reachable: |a| reachable(ecx, a),
216+
abbrevs: tyencode::ac_use_abbrevs(ecx.type_abbrevs)};
216217
tyencode::enc_ty(ebml_w.writer, ty_str_ctxt, typ);
217218
}
218219

219220
fn write_vstore(ecx: @encode_ctxt, ebml_w: writer::Encoder,
220221
vstore: ty::vstore) {
221-
let ty_str_ctxt =
222-
@{diag: ecx.diag,
223-
ds: def_to_str,
224-
tcx: ecx.tcx,
225-
reachable: |a| reachable(ecx, a),
226-
abbrevs: tyencode::ac_use_abbrevs(ecx.type_abbrevs)};
222+
let ty_str_ctxt = @tyencode::ctxt {
223+
diag: ecx.diag,
224+
ds: def_to_str,
225+
tcx: ecx.tcx,
226+
reachable: |a| reachable(ecx, a),
227+
abbrevs: tyencode::ac_use_abbrevs(ecx.type_abbrevs)};
227228
tyencode::enc_vstore(ebml_w.writer, ty_str_ctxt, vstore);
228229
}
229230

@@ -887,7 +888,7 @@ fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: writer::Encoder,
887888
encode_info_for_mod(ecx, ebml_w, crate.node.module,
888889
crate_node_id, ~[],
889890
syntax::parse::token::special_idents::invalid);
890-
visit::visit_crate(*crate, (), visit::mk_vt(@{
891+
visit::visit_crate(*crate, (), visit::mk_vt(@visit::Visitor {
891892
visit_expr: |_e, _cx, _v| { },
892893
visit_item: |i, cx, v, copy ebml_w| {
893894
visit::visit_item(i, cx, v);
@@ -1267,11 +1268,12 @@ fn encode_metadata(parms: encode_parms, crate: @crate) -> ~[u8] {
12671268

12681269
// Get the encoded string for a type
12691270
fn encoded_ty(tcx: ty::ctxt, t: ty::t) -> ~str {
1270-
let cx = @{diag: tcx.diag,
1271-
ds: def_to_str,
1272-
tcx: tcx,
1273-
reachable: |_id| false,
1274-
abbrevs: tyencode::ac_no_abbrevs};
1271+
let cx = @tyencode::ctxt {
1272+
diag: tcx.diag,
1273+
ds: def_to_str,
1274+
tcx: tcx,
1275+
reachable: |_id| false,
1276+
abbrevs: tyencode::ac_no_abbrevs};
12751277
do io::with_str_writer |wr| {
12761278
tyencode::enc_ty(wr, cx, t);
12771279
}

branches/try/src/librustc/metadata/tyencode.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use core::prelude::*;
1515

1616
use middle::ty;
17-
use middle::ty::vid;
17+
use middle::ty::Vid;
1818

1919
use core::io::WriterUtil;
2020
use core::io;
@@ -24,6 +24,7 @@ use std::map::HashMap;
2424
use syntax::ast::*;
2525
use syntax::diagnostic::span_handler;
2626
use syntax::print::pprust::*;
27+
use middle::ty::Vid;
2728

2829
export ctxt;
2930
export ty_abbrev;
@@ -35,15 +36,15 @@ export enc_mode;
3536
export enc_arg;
3637
export enc_vstore;
3738

38-
type ctxt = {
39+
struct ctxt {
3940
diag: span_handler,
4041
// Def -> str Callback:
4142
ds: fn@(def_id) -> ~str,
4243
// The type context.
4344
tcx: ty::ctxt,
4445
reachable: fn@(node_id) -> bool,
4546
abbrevs: abbrev_ctxt
46-
};
47+
}
4748

4849
// Compact string representation for ty.t values. API ty_str & parse_from_str.
4950
// Extra parameters are for converting to/from def_ids in the string rep.

branches/try/src/librustc/middle/astencode.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ fn simplify_ast(ii: ast::inlined_item) -> ast::inlined_item {
271271
fold::noop_fold_block(blk_sans_items, fld)
272272
}
273273

274-
let fld = fold::make_fold(@{
274+
let fld = fold::make_fold(@fold::AstFoldFns {
275275
fold_block: fold::wrap(drop_nested_items),
276276
.. *fold::default_ast_fold()
277277
});
@@ -304,7 +304,7 @@ fn decode_ast(par_doc: ebml::Doc) -> ast::inlined_item {
304304

305305
fn renumber_ast(xcx: extended_decode_ctxt, ii: ast::inlined_item)
306306
-> ast::inlined_item {
307-
let fld = fold::make_fold(@{
307+
let fld = fold::make_fold(@fold::AstFoldFns{
308308
new_id: |a| xcx.tr_id(a),
309309
new_span: |a| xcx.tr_span(a),
310310
.. *fold::default_ast_fold()
@@ -643,11 +643,11 @@ trait get_ty_str_ctxt {
643643

644644
impl @e::encode_ctxt: get_ty_str_ctxt {
645645
fn ty_str_ctxt() -> @tyencode::ctxt {
646-
@{diag: self.tcx.sess.diagnostic(),
647-
ds: e::def_to_str,
648-
tcx: self.tcx,
649-
reachable: |a| encoder::reachable(self, a),
650-
abbrevs: tyencode::ac_use_abbrevs(self.type_abbrevs)}
646+
@tyencode::ctxt {diag: self.tcx.sess.diagnostic(),
647+
ds: e::def_to_str,
648+
tcx: self.tcx,
649+
reachable: |a| encoder::reachable(self, a),
650+
abbrevs: tyencode::ac_use_abbrevs(self.type_abbrevs)}
651651
}
652652
}
653653

branches/try/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ fn check_loans(bccx: borrowck_ctxt,
9292
reported: HashMap(),
9393
mut declared_purity: ast::impure_fn,
9494
mut fn_args: @~[]});
95-
let vt = visit::mk_vt(@{visit_expr: check_loans_in_expr,
96-
visit_local: check_loans_in_local,
97-
visit_block: check_loans_in_block,
98-
visit_fn: check_loans_in_fn,
99-
.. *visit::default_visitor()});
95+
let vt = visit::mk_vt(@visit::Visitor {visit_expr: check_loans_in_expr,
96+
visit_local: check_loans_in_local,
97+
visit_block: check_loans_in_block,
98+
visit_fn: check_loans_in_fn,
99+
.. *visit::default_visitor()});
100100
visit::visit_crate(*crate, clcx, vt);
101101
}
102102

@@ -247,13 +247,13 @@ impl check_loan_ctxt {
247247
let callee_ty = ty::node_id_to_type(tcx, callee_id);
248248
match ty::get(callee_ty).sty {
249249
ty::ty_fn(ref fn_ty) => {
250-
match (*fn_ty).meta.purity {
250+
match fn_ty.meta.purity {
251251
ast::pure_fn => return, // case (c) above
252252
ast::impure_fn | ast::unsafe_fn | ast::extern_fn => {
253253
self.report_purity_error(
254254
pc, callee_span,
255255
fmt!("access to %s function",
256-
pprust::purity_to_str((*fn_ty).meta.purity)));
256+
fn_ty.meta.purity.to_str()));
257257
}
258258
}
259259
}

branches/try/src/librustc/middle/borrowck/gather_loans.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ fn gather_loans(bccx: borrowck_ctxt, crate: @ast::crate) -> req_maps {
8282
mut item_ub: 0,
8383
mut root_ub: 0,
8484
mut ignore_adjustments: LinearMap()});
85-
let v = visit::mk_vt(@{visit_expr: req_loans_in_expr,
86-
visit_fn: req_loans_in_fn,
87-
.. *visit::default_visitor()});
85+
let v = visit::mk_vt(@visit::Visitor {visit_expr: req_loans_in_expr,
86+
visit_fn: req_loans_in_fn,
87+
.. *visit::default_visitor()});
8888
visit::visit_crate(*crate, glcx, v);
8989
return glcx.req_maps;
9090
}

branches/try/src/librustc/middle/borrowck/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ use core::prelude::*;
231231
use middle::liveness;
232232
use middle::mem_categorization::*;
233233
use middle::region;
234-
use middle::ty::to_str;
235234
use middle::ty;
236235
use util::common::indenter;
237236
use util::ppaux::{expr_repr, note_and_explain_region};

branches/try/src/librustc/middle/check_const.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use syntax::{visit, ast_util, ast_map};
2525
fn check_crate(sess: Session, crate: @crate, ast_map: ast_map::map,
2626
def_map: resolve::DefMap,
2727
method_map: typeck::method_map, tcx: ty::ctxt) {
28-
visit::visit_crate(*crate, false, visit::mk_vt(@{
28+
visit::visit_crate(*crate, false, visit::mk_vt(@visit::Visitor {
2929
visit_item: |a,b,c| check_item(sess, ast_map, def_map, a, b, c),
3030
visit_pat: check_pat,
3131
visit_expr: |a,b,c|
@@ -211,7 +211,7 @@ fn check_item_recursion(sess: Session, ast_map: ast_map::map,
211211
idstack: @DVec()
212212
};
213213

214-
let visitor = visit::mk_vt(@{
214+
let visitor = visit::mk_vt(@visit::Visitor {
215215
visit_item: visit_item,
216216
visit_expr: visit_expr,
217217
.. *visit::default_visitor()

branches/try/src/librustc/middle/check_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type ctx = {in_loop: bool, can_ret: bool};
1919
fn check_crate(tcx: ty::ctxt, crate: @crate) {
2020
visit::visit_crate(*crate,
2121
{in_loop: false, can_ret: true},
22-
visit::mk_vt(@{
22+
visit::mk_vt(@visit::Visitor {
2323
visit_item: |i, _cx, v| {
2424
visit::visit_item(i, {in_loop: false, can_ret: true}, v);
2525
},

0 commit comments

Comments
 (0)