Skip to content

Commit 21e16ab

Browse files
committed
---
yaml --- r: 6995 b: refs/heads/master c: 9f2369d h: refs/heads/master i: 6993: 3f260c9 6991: 63e5d22 v: v3
1 parent 76861fa commit 21e16ab

File tree

9 files changed

+42
-43
lines changed

9 files changed

+42
-43
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 270b4273e79aac33f424673caf455f839da2bb40
2+
refs/heads/master: 9f2369dc9f55a22cfc0bc8b62a8588afe2c8b2ca

trunk/src/comp/metadata/decoder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ fn item_type(item: ebml::doc, this_cnum: ast::crate_num, tcx: ty::ctxt,
117117

118118
fn item_ty_param_bounds(item: ebml::doc, this_cnum: ast::crate_num,
119119
tcx: ty::ctxt, extres: external_resolver)
120-
-> [@[ty::param_bound]] {
120+
-> @[ty::param_bounds] {
121121
let bounds = [];
122122
let def_parser = bind parse_external_def_id(this_cnum, extres, _);
123123
ebml::tagged_docs(item, tag_items_data_item_ty_param_bounds) {|p|
124124
bounds += [tydecode::parse_bounds_data(@ebml::doc_data(p), this_cnum,
125125
def_parser, tcx)];
126126
}
127-
bounds
127+
@bounds
128128
}
129129

130130
fn item_ty_param_count(item: ebml::doc) -> uint {
@@ -209,8 +209,8 @@ fn get_type(data: @[u8], def: ast::def_id, tcx: ty::ctxt,
209209
let t = item_type(item, this_cnum, tcx, extres);
210210
let tp_bounds = if family_has_type_params(item_family(item)) {
211211
item_ty_param_bounds(item, this_cnum, tcx, extres)
212-
} else { [] };
213-
ret @{bounds: tp_bounds, ty: t};
212+
} else { @[] };
213+
ret {bounds: tp_bounds, ty: t};
214214
}
215215

216216
fn get_type_param_count(data: @[u8], id: ast::node_id) -> uint {

trunk/src/comp/metadata/tydecode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
267267
while peek(st) as char != '[' {
268268
name += str::unsafe_from_byte(next(st));
269269
}
270-
methods += [{ident: name, tps: [],
270+
methods += [{ident: name, tps: @[],
271271
fty: {proto: proto with parse_ty_fn(st, sd)}}];
272272
}
273273
st.pos += 1u;

trunk/src/comp/middle/shape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ fn gen_tag_shapes(ccx: @crate_ctxt) -> ValueRef {
450450
let did = ccx.shape_cx.tag_order[i];
451451
let variants = ty::tag_variants(ccx.tcx, did);
452452
let item_tyt = ty::lookup_item_type(ccx.tcx, did);
453-
let ty_param_count = vec::len(item_tyt.bounds);
453+
let ty_param_count = vec::len(*item_tyt.bounds);
454454

455455
for v: ty::variant_info in *variants {
456456
offsets += [vec::len(data) as u16];

trunk/src/comp/middle/trans.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ fn type_of_ty_param_bounds_and_ty(lcx: @local_ctxt, sp: span,
236236
alt ty::struct(cx.tcx, t) {
237237
ty::ty_fn(_) | ty::ty_native_fn(_, _) {
238238
check returns_non_ty_var(cx, t);
239-
ret type_of_fn_from_ty(cx, sp, t, tpt.bounds);
239+
ret type_of_fn_from_ty(cx, sp, t, *tpt.bounds);
240240
}
241241
_ {
242242
// fall through
@@ -2565,7 +2565,7 @@ type generic_info =
25652565
{item_type: ty::t,
25662566
static_tis: [option::t<@tydesc_info>],
25672567
tydescs: [ValueRef],
2568-
param_bounds: [ty::param_bounds]};
2568+
param_bounds: @[ty::param_bounds]};
25692569

25702570
tag lval_kind {
25712571
temporary; //< Temporary value passed by value if of immediate type
@@ -2739,7 +2739,7 @@ fn trans_var(cx: @block_ctxt, sp: span, def: ast::def, id: ast::node_id)
27392739
ret lval_no_env(cx, ccx.consts.get(did.node), owned);
27402740
} else {
27412741
let tp = ty::node_id_to_monotype(ccx.tcx, id);
2742-
let val = trans_external_path(cx, did, @{bounds: [], ty: tp});
2742+
let val = trans_external_path(cx, did, {bounds: @[], ty: tp});
27432743
ret lval_no_env(cx, load_if_immediate(cx, val, tp), owned_imm);
27442744
}
27452745
}

trunk/src/comp/middle/trans_closure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ fn trans_bind_1(cx: @block_ctxt, outgoing_fty: ty::t,
437437

438438
// Figure out which tydescs we need to pass, if any.
439439
let (outgoing_fty_real, lltydescs, param_bounds) = alt f_res.generic {
440-
none. { (outgoing_fty, [], []) }
440+
none. { (outgoing_fty, [], @[]) }
441441
some(ginfo) {
442442
lazily_emit_all_generic_info_tydesc_glues(cx, ginfo);
443443
(ginfo.item_type, ginfo.tydescs, ginfo.param_bounds)
@@ -484,7 +484,7 @@ fn trans_bind_1(cx: @block_ctxt, outgoing_fty: ty::t,
484484
// Make thunk
485485
let llthunk =
486486
trans_bind_thunk(cx.fcx.lcx, cx.sp, pair_ty, outgoing_fty_real, args,
487-
box_ty, param_bounds, target_res);
487+
box_ty, *param_bounds, target_res);
488488

489489
// Fill the function pair
490490
fill_fn_pair(bcx, get_dest_addr(dest), llthunk.val, llbox);

trunk/src/comp/middle/trans_common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ fn get_res_dtor(ccx: @crate_ctxt, sp: span, did: ast::def_id, inner_t: ty::t)
326326
check non_ty_var(ccx, nil_res);
327327
let f_t = type_of_fn(ccx, sp, false,
328328
[{mode: ast::by_ref, ty: inner_t}],
329-
nil_res, param_bounds);
329+
nil_res, *param_bounds);
330330
ret trans::get_extern_const(ccx.externs, ccx.llmod,
331331
csearch::get_symbol(ccx.sess.get_cstore(),
332332
did), f_t);

trunk/src/comp/middle/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ type field = {ident: ast::ident, mt: mt};
196196

197197
type param_bounds = @[param_bound];
198198

199-
type method = {ident: ast::ident, tps: [param_bounds], fty: fn_ty};
199+
type method = {ident: ast::ident, tps: @[param_bounds], fty: fn_ty};
200200

201201
type constr_table = hashmap<ast::node_id, [constr]>;
202202

@@ -324,7 +324,7 @@ fn param_bounds_to_kind(bounds: param_bounds) -> kind {
324324
kind
325325
}
326326

327-
type ty_param_bounds_and_ty = @{bounds: [param_bounds], ty: t};
327+
type ty_param_bounds_and_ty = {bounds: @[param_bounds], ty: t};
328328

329329
type type_cache = hashmap<ast::def_id, ty_param_bounds_and_ty>;
330330

trunk/src/comp/middle/typeck.rs

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,22 @@ fn ty_param_bounds_and_ty_for_def(fcx: @fn_ctxt, sp: span, defn: ast::def) ->
8080
ast::def_arg(id, _) {
8181
assert (fcx.locals.contains_key(id.node));
8282
let typ = ty::mk_var(fcx.ccx.tcx, lookup_local(fcx, sp, id.node));
83-
ret @{bounds: [], ty: typ};
83+
ret {bounds: @[], ty: typ};
8484
}
8585
ast::def_local(id, _) {
8686
assert (fcx.locals.contains_key(id.node));
8787
let typ = ty::mk_var(fcx.ccx.tcx, lookup_local(fcx, sp, id.node));
88-
ret @{bounds: [], ty: typ};
88+
ret {bounds: @[], ty: typ};
8989
}
9090
ast::def_obj_field(id, _) {
9191
assert (fcx.locals.contains_key(id.node));
9292
let typ = ty::mk_var(fcx.ccx.tcx, lookup_local(fcx, sp, id.node));
93-
ret @{bounds: [], ty: typ};
93+
ret {bounds: @[], ty: typ};
9494
}
9595
ast::def_self(id) {
9696
alt get_self_info(fcx.ccx) {
9797
some(self_obj(_, obj_t)) | some(self_impl(obj_t)) {
98-
ret @{bounds: [], ty: obj_t};
98+
ret {bounds: @[], ty: obj_t};
9999
}
100100
}
101101
}
@@ -106,12 +106,12 @@ fn ty_param_bounds_and_ty_for_def(fcx: @fn_ctxt, sp: span, defn: ast::def) ->
106106
ast::def_binding(id) {
107107
assert (fcx.locals.contains_key(id.node));
108108
let typ = ty::mk_var(fcx.ccx.tcx, lookup_local(fcx, sp, id.node));
109-
ret @{bounds: [], ty: typ};
109+
ret {bounds: @[], ty: typ};
110110
}
111111
ast::def_mod(_) {
112112
// Hopefully part of a path.
113113
// TODO: return a type that's more poisonous, perhaps?
114-
ret @{bounds: [], ty: ty::mk_nil(fcx.ccx.tcx)};
114+
ret {bounds: @[], ty: ty::mk_nil(fcx.ccx.tcx)};
115115
}
116116
ast::def_ty(_) {
117117
fcx.ccx.tcx.sess.span_fatal(sp, "expected value but found type");
@@ -132,7 +132,7 @@ fn ty_param_bounds_and_ty_for_def(fcx: @fn_ctxt, sp: span, defn: ast::def) ->
132132
fn instantiate_path(fcx: @fn_ctxt, pth: @ast::path,
133133
tpt: ty_param_bounds_and_ty, sp: span)
134134
-> ty_param_substs_opt_and_ty {
135-
let ty_param_count = vec::len(tpt.bounds);
135+
let ty_param_count = vec::len(*tpt.bounds);
136136
let bind_result =
137137
bind_params_in_type(sp, fcx.ccx.tcx, bind next_ty_var_id(fcx), tpt.ty,
138138
ty_param_count);
@@ -286,13 +286,13 @@ fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t {
286286
// "foo = int" like OCaml?
287287

288288
let ty_param_bounds_and_ty = getter(tcx, mode, id);
289-
if vec::len(ty_param_bounds_and_ty.bounds) == 0u {
289+
if vec::len(*ty_param_bounds_and_ty.bounds) == 0u {
290290
ret ty_param_bounds_and_ty.ty;
291291
}
292292

293293
// The typedef is type-parametric. Do the type substitution.
294294
let param_bindings: [ty::t] = [];
295-
if vec::len(args) != vec::len(ty_param_bounds_and_ty.bounds) {
295+
if vec::len(args) != vec::len(*ty_param_bounds_and_ty.bounds) {
296296
tcx.sess.span_fatal(sp, "Wrong number of type arguments for a \
297297
polymorphic type");
298298
}
@@ -386,7 +386,7 @@ fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
386386
alt it.node {
387387
ast::item_const(t, _) {
388388
let typ = ast_ty_to_ty(tcx, mode, t);
389-
let tpt = @{bounds: [], ty: typ};
389+
let tpt = {bounds: @[], ty: typ};
390390
tcx.tcache.insert(local_def(it.id), tpt);
391391
ret tpt;
392392
}
@@ -405,7 +405,7 @@ fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
405405
}
406406
// Tell ast_ty_to_ty() that we want to perform a recursive
407407
// call to resolve any named types.
408-
let tpt = @{bounds: ty_param_bounds(tcx, mode, tps),
408+
let tpt = {bounds: ty_param_bounds(tcx, mode, tps),
409409
ty: ty::mk_named(tcx, ast_ty_to_ty(tcx, mode, t),
410410
@it.ident)};
411411
tcx.tcache.insert(local_def(it.id), tpt);
@@ -417,7 +417,7 @@ fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
417417
let t = ty::mk_named(tcx, ty::mk_res(tcx, local_def(it.id), t_arg.ty,
418418
params),
419419
@it.ident);
420-
let t_res = @{bounds: bounds, ty: t};
420+
let t_res = {bounds: bounds, ty: t};
421421
tcx.tcache.insert(local_def(it.id), t_res);
422422
ret t_res;
423423
}
@@ -426,7 +426,7 @@ fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
426426
let {bounds, params} = mk_ty_params(tcx, tps);
427427
let t = ty::mk_named(tcx, ty::mk_tag(tcx, local_def(it.id), params),
428428
@it.ident);
429-
let tpt = @{bounds: bounds, ty: t};
429+
let tpt = {bounds: bounds, ty: t};
430430
tcx.tcache.insert(local_def(it.id), tpt);
431431
ret tpt;
432432
}
@@ -435,7 +435,7 @@ fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
435435
let t = ty::mk_named(tcx, ty::mk_iface(tcx, local_def(it.id),
436436
params),
437437
@it.ident);
438-
let tpt = @{bounds: bounds, ty: t};
438+
let tpt = {bounds: bounds, ty: t};
439439
tcx.tcache.insert(local_def(it.id), tpt);
440440
ty::store_iface_methods(tcx, it.id, @vec::map(ms, {|m|
441441
ty_of_ty_method(tcx, m_collect, m)
@@ -459,7 +459,7 @@ fn ty_of_native_item(tcx: ty::ctxt, mode: mode, it: @ast::native_item)
459459
none. { }
460460
}
461461
let t = ty::mk_native(tcx, ast_util::local_def(it.id));
462-
let tpt = @{bounds: [], ty: t};
462+
let tpt = {bounds: @[], ty: t};
463463
tcx.tcache.insert(local_def(it.id), tpt);
464464
ret tpt;
465465
}
@@ -487,7 +487,7 @@ fn ty_of_fn(tcx: ty::ctxt, mode: mode, decl: ast::fn_decl,
487487
-> ty::ty_param_bounds_and_ty {
488488
let bounds = ty_param_bounds(tcx, mode, ty_params);
489489
let tofd = ty_of_fn_decl(tcx, mode, ast::proto_bare, decl);
490-
let tpt = @{bounds: bounds, ty: ty::mk_fn(tcx, tofd)};
490+
let tpt = {bounds: bounds, ty: ty::mk_fn(tcx, tofd)};
491491
tcx.tcache.insert(def_id, tpt);
492492
ret tpt;
493493
}
@@ -499,12 +499,12 @@ fn ty_of_native_fn_decl(tcx: ty::ctxt, mode: mode, decl: ast::fn_decl,
499499
let output_ty = ast_ty_to_ty(tcx, mode, decl.output);
500500

501501
let t_fn = ty::mk_native_fn(tcx, input_tys, output_ty);
502-
let tpt = @{bounds: bounds, ty: t_fn};
502+
let tpt = {bounds: bounds, ty: t_fn};
503503
tcx.tcache.insert(def_id, tpt);
504504
ret tpt;
505505
}
506506
fn ty_param_bounds(tcx: ty::ctxt, mode: mode, params: [ast::ty_param])
507-
-> [ty::param_bounds] {
507+
-> @[ty::param_bounds] {
508508
let result = [];
509509
for param in params {
510510
result += [alt tcx.ty_param_bounds.find(local_def(param.id)) {
@@ -526,7 +526,7 @@ fn ty_param_bounds(tcx: ty::ctxt, mode: mode, params: [ast::ty_param])
526526
}
527527
}];
528528
}
529-
result
529+
@result
530530
}
531531
fn ty_of_method(tcx: ty::ctxt, mode: mode, m: @ast::method) -> ty::method {
532532
{ident: m.ident, tps: ty_param_bounds(tcx, mode, m.tps),
@@ -543,7 +543,7 @@ fn ty_of_obj(tcx: ty::ctxt, mode: mode, id: ast::ident, ob: ast::_obj,
543543
let methods = vec::map(ob.methods, {|m| ty_of_method(tcx, mode, m)});
544544
let t_obj = ty::mk_named(tcx, ty::mk_obj(tcx, ty::sort_methods(methods)),
545545
@id);
546-
ret @{bounds: bounds, ty: t_obj};
546+
ret {bounds: bounds, ty: t_obj};
547547
}
548548
fn ty_of_obj_ctor(tcx: ty::ctxt, mode: mode, id: ast::ident, ob: ast::_obj,
549549
ctor_id: ast::node_id, ty_params: [ast::ty_param])
@@ -557,7 +557,7 @@ fn ty_of_obj_ctor(tcx: ty::ctxt, mode: mode, id: ast::ident, ob: ast::_obj,
557557
let t_fn = ty::mk_fn(tcx, {proto: ast::proto_shared(ast::sugar_normal),
558558
inputs: t_inputs, output: t_obj.ty,
559559
ret_style: ast::return_val, constraints: []});
560-
let tpt = @{bounds: ty_param_bounds(tcx, mode, ty_params), ty: t_fn};
560+
let tpt = {bounds: ty_param_bounds(tcx, mode, ty_params), ty: t_fn};
561561
tcx.tcache.insert(local_def(ctor_id), tpt);
562562
ret tpt;
563563
}
@@ -626,7 +626,7 @@ mod write {
626626
}
627627

628628
fn mk_ty_params(tcx: ty::ctxt, atps: [ast::ty_param])
629-
-> {bounds: [ty::param_bounds], params: [ty::t]} {
629+
-> {bounds: @[ty::param_bounds], params: [ty::t]} {
630630
let i = 0u, bounds = ty_param_bounds(tcx, m_collect, atps);
631631
{bounds: bounds,
632632
params: vec::map(atps, {|atp|
@@ -678,7 +678,7 @@ mod collect {
678678
inputs: args, output: tag_ty,
679679
ret_style: ast::return_val, constraints: []})
680680
};
681-
let tpt = @{bounds: ty_param_bounds(cx.tcx, m_collect, ty_params),
681+
let tpt = {bounds: ty_param_bounds(cx.tcx, m_collect, ty_params),
682682
ty: result_ty};
683683
cx.tcx.tcache.insert(local_def(variant.node.id), tpt);
684684
write::ty_only(cx.tcx, variant.node.id, result_ty);
@@ -700,7 +700,7 @@ mod collect {
700700
let ty = ty::mk_fn(cx.tcx,
701701
ty_of_fn_decl(cx.tcx, m_collect,
702702
ast::proto_bare, m.decl));
703-
cx.tcx.tcache.insert(local_def(m.id), @{bounds: bounds,
703+
cx.tcx.tcache.insert(local_def(m.id), {bounds: bounds,
704704
ty: ty});
705705
write::ty_only(cx.tcx, m.id, ty);
706706
}
@@ -758,8 +758,7 @@ mod collect {
758758
write::ty_only(cx.tcx, it.id, t_res);
759759
write::ty_only(cx.tcx, ctor_id, t_ctor);
760760
cx.tcx.tcache.insert(local_def(ctor_id),
761-
@{bounds: bounds,
762-
ty: t_ctor});
761+
{bounds: bounds, ty: t_ctor});
763762
write::ty_only(cx.tcx, dtor_id, t_dtor);
764763
}
765764
_ {
@@ -1481,7 +1480,7 @@ fn impl_self_ty(tcx: ty::ctxt, did: ast::def_id) -> {n_tps: uint, ty: ty::t} {
14811480
}
14821481
} else {
14831482
let tpt = csearch::get_type(tcx, did);
1484-
{n_tps: vec::len(tpt.bounds), ty: tpt.ty}
1483+
{n_tps: vec::len(*tpt.bounds), ty: tpt.ty}
14851484
}
14861485
}
14871486

@@ -1505,7 +1504,7 @@ fn lookup_method(fcx: @fn_ctxt, isc: resolve::iscopes,
15051504
{|m| m.ident == name}) {
15061505
some(m) {
15071506
ret some({method_ty: ty::mk_fn(tcx, m.fty),
1508-
n_tps: vec::len(m.tps),
1507+
n_tps: vec::len(*m.tps),
15091508
ids: [], // FIXME[impl]
15101509
origin: method_param(n)});
15111510
}

0 commit comments

Comments
 (0)