Skip to content

Commit 1c29bab

Browse files
committed
---
yaml --- r: 42427 b: refs/heads/try c: 530a113 h: refs/heads/master i: 42425: 901f3d6 42423: 911d2ec v: v3
1 parent 0c873aa commit 1c29bab

File tree

17 files changed

+94
-76
lines changed

17 files changed

+94
-76
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: 19dfec2aaf746535de1521f68421f9980dbf25de
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
5-
refs/heads/try: ebea895d026722e5887bd6544639152b87a80cc5
5+
refs/heads/try: 530a113bfa2702b415e38f3168d5c95ee1d93718
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

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

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,14 @@ fn mk_test_module(cx: test_ctxt) -> @ast::item {
225225
// This attribute tells resolve to let us call unexported functions
226226
let resolve_unexported_attr =
227227
attr::mk_attr(attr::mk_word_item(~"!resolve_unexported"));
228-
let item: ast::item =
229-
{ident: cx.sess.ident_of(~"__test"),
230-
attrs: ~[resolve_unexported_attr],
231-
id: cx.sess.next_node_id(),
232-
node: item_,
233-
vis: ast::public,
234-
span: dummy_sp()};
228+
let item = ast::item {
229+
ident: cx.sess.ident_of(~"__test"),
230+
attrs: ~[resolve_unexported_attr],
231+
id: cx.sess.next_node_id(),
232+
node: item_,
233+
vis: ast::public,
234+
span: dummy_sp(),
235+
};
235236

236237
debug!("Synthetic test module:\n%s\n",
237238
pprust::item_to_str(@copy item, cx.sess.intr()));
@@ -293,13 +294,14 @@ fn mk_tests(cx: test_ctxt) -> @ast::item {
293294
let body = nospan(body_);
294295

295296
let item_ = ast::item_fn(decl, ast::impure_fn, ~[], body);
296-
let item: ast::item =
297-
{ident: cx.sess.ident_of(~"tests"),
298-
attrs: ~[],
299-
id: cx.sess.next_node_id(),
300-
node: item_,
301-
vis: ast::public,
302-
span: dummy_sp()};
297+
let item = ast::item {
298+
ident: cx.sess.ident_of(~"tests"),
299+
attrs: ~[],
300+
id: cx.sess.next_node_id(),
301+
node: item_,
302+
vis: ast::public,
303+
span: dummy_sp(),
304+
};
303305
return @item;
304306
}
305307

@@ -503,13 +505,14 @@ fn mk_main(cx: test_ctxt) -> @ast::item {
503505
let body = ast::spanned { node: body_, span: dummy_sp() };
504506

505507
let item_ = ast::item_fn(decl, ast::impure_fn, ~[], body);
506-
let item: ast::item =
507-
{ident: cx.sess.ident_of(~"main"),
508-
attrs: ~[attr::mk_attr(attr::mk_word_item(~"main"))],
509-
id: cx.sess.next_node_id(),
510-
node: item_,
511-
vis: ast::public,
512-
span: dummy_sp()};
508+
let item = ast::item {
509+
ident: cx.sess.ident_of(~"main"),
510+
attrs: ~[attr::mk_attr(attr::mk_word_item(~"main"))],
511+
id: cx.sess.next_node_id(),
512+
node: item_,
513+
vis: ast::public,
514+
span: dummy_sp(),
515+
};
513516
return @item;
514517
}
515518

branches/try/src/librustc/middle/trans/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ fn get_const_val(cx: @crate_ctxt, def_id: ast::def_id) -> ValueRef {
126126
}
127127
if !cx.const_values.contains_key(def_id.node) {
128128
match cx.tcx.items.get(def_id.node) {
129-
ast_map::node_item(@{
129+
ast_map::node_item(@ast::item {
130130
node: ast::item_const(_, subexpr), _
131131
}, _) => {
132132
trans_const(cx, subexpr, def_id.node);

branches/try/src/librustc/middle/trans/meth.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ fn method_with_name(ccx: @crate_ctxt, impl_id: ast::def_id,
327327
name: ast::ident) -> ast::def_id {
328328
if impl_id.crate == ast::local_crate {
329329
match ccx.tcx.items.get(impl_id.node) {
330-
ast_map::node_item(@{
330+
ast_map::node_item(@ast::item {
331331
node: ast::item_impl(_, _, _, ref ms),
332332
_
333333
}, _) => {
@@ -344,7 +344,7 @@ fn method_with_name_or_default(ccx: @crate_ctxt, impl_id: ast::def_id,
344344
name: ast::ident) -> ast::def_id {
345345
if impl_id.crate == ast::local_crate {
346346
match ccx.tcx.items.get(impl_id.node) {
347-
ast_map::node_item(@{
347+
ast_map::node_item(@ast::item {
348348
node: ast::item_impl(_, _, _, ref ms), _
349349
}, _) => {
350350
let did = method_from_methods(/*bad*/copy *ms, name);

branches/try/src/librustc/middle/trans/monomorphize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fn monomorphic_fn(ccx: @crate_ctxt,
167167
});
168168

169169
let lldecl = match map_node {
170-
ast_map::node_item(i@@{
170+
ast_map::node_item(i@@ast::item {
171171
// XXX: Bad copy.
172172
node: ast::item_fn(copy decl, _, _, ref body),
173173
_

branches/try/src/librustc/middle/trans/type_use.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint)
9494
fn_id_loc))
9595
};
9696
match map_node {
97-
ast_map::node_item(@{node: item_fn(_, _, _, ref body), _}, _) |
97+
ast_map::node_item(@ast::item { node: item_fn(_, _, _, ref body),
98+
_ }, _) |
9899
ast_map::node_method(@{body: ref body, _}, _, _) => {
99100
handle_body(cx, (*body));
100101
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3609,7 +3609,7 @@ fn store_trait_methods(cx: ctxt, id: ast::node_id, ms: @~[method]) {
36093609
fn provided_trait_methods(cx: ctxt, id: ast::def_id) -> ~[ast::ident] {
36103610
if is_local(id) {
36113611
match cx.items.find(id.node) {
3612-
Some(ast_map::node_item(@{
3612+
Some(ast_map::node_item(@ast::item {
36133613
node: item_trait(_, _, ref ms),
36143614
_
36153615
}, _)) =>
@@ -3690,7 +3690,7 @@ fn impl_traits(cx: ctxt, id: ast::def_id, vstore: vstore) -> ~[t] {
36903690
if id.crate == ast::local_crate {
36913691
debug!("(impl_traits) searching for trait impl %?", id);
36923692
match cx.items.find(id.node) {
3693-
Some(ast_map::node_item(@{
3693+
Some(ast_map::node_item(@ast::item {
36943694
node: ast::item_impl(_, opt_trait, _, _),
36953695
_},
36963696
_)) => {
@@ -3797,7 +3797,7 @@ fn ty_dtor(cx: ctxt, struct_id: def_id) -> DtorKind {
37973797

37983798
if is_local(struct_id) {
37993799
match cx.items.find(struct_id.node) {
3800-
Some(ast_map::node_item(@{
3800+
Some(ast_map::node_item(@ast::item {
38013801
node: ast::item_struct(@{ dtor: Some(ref dtor), _ }, _),
38023802
_
38033803
}, _)) =>
@@ -3900,7 +3900,7 @@ fn enum_variants(cx: ctxt, id: ast::def_id) -> @~[VariantInfo] {
39003900
expr, since check_enum_variants also updates the enum_var_cache
39013901
*/
39023902
match cx.items.get(id.node) {
3903-
ast_map::node_item(@{
3903+
ast_map::node_item(@ast::item {
39043904
node: ast::item_enum(ref enum_definition, _),
39053905
_
39063906
}, _) => {

branches/try/src/librustc/middle/typeck/check/mod.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,14 +1008,19 @@ pub fn impl_self_ty(vcx: &VtableContext,
10081008
let {n_tps, region_param, raw_ty} = if did.crate == ast::local_crate {
10091009
let region_param = tcx.region_paramd_items.find(did.node);
10101010
match tcx.items.find(did.node) {
1011-
Some(ast_map::node_item(@{node: ast::item_impl(ref ts, _, st, _),
1012-
_}, _)) => {
1011+
Some(ast_map::node_item(@ast::item {
1012+
node: ast::item_impl(ref ts, _, st, _),
1013+
_
1014+
}, _)) => {
10131015
{n_tps: ts.len(),
10141016
region_param: region_param,
10151017
raw_ty: vcx.ccx.to_ty(rscope::type_rscope(region_param), st)}
10161018
}
1017-
Some(ast_map::node_item(@{node: ast::item_struct(_, ref ts),
1018-
id: class_id, _},_)) => {
1019+
Some(ast_map::node_item(@ast::item {
1020+
node: ast::item_struct(_, ref ts),
1021+
id: class_id,
1022+
_
1023+
},_)) => {
10191024
/* If the impl is a class, the self ty is just the class ty
10201025
(doing a no-op subst for the ty params; in the next step,
10211026
we substitute in fresh vars for them)
@@ -1768,7 +1773,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
17681773
region_parameterized =
17691774
tcx.region_paramd_items.find(class_id.node);
17701775
match tcx.items.find(class_id.node) {
1771-
Some(ast_map::node_item(@{
1776+
Some(ast_map::node_item(@ast::item {
17721777
node: ast::item_struct(_, ref type_parameters),
17731778
_
17741779
}, _)) => {
@@ -1851,7 +1856,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
18511856
region_parameterized =
18521857
tcx.region_paramd_items.find(enum_id.node);
18531858
match tcx.items.find(enum_id.node) {
1854-
Some(ast_map::node_item(@{
1859+
Some(ast_map::node_item(@ast::item {
18551860
node: ast::item_enum(_, ref type_parameters),
18561861
_
18571862
}, _)) => {

branches/try/src/librustc/middle/typeck/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ fn ensure_trait_methods(ccx: @crate_ctxt, id: ast::node_id, trait_ty: ty::t) {
282282
let tcx = ccx.tcx;
283283
let region_paramd = tcx.region_paramd_items.find(id);
284284
match tcx.items.get(id) {
285-
ast_map::node_item(@{
285+
ast_map::node_item(@ast::item {
286286
node: ast::item_trait(ref params, _, ref ms),
287287
_
288288
}, _) => {

branches/try/src/librustdoc/attr_pass.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fn fold_enum(
167167
let variant = *variant;
168168
let desc = do astsrv::exec(srv) |ctxt| {
169169
match ctxt.ast_map.get(doc_id) {
170-
ast_map::node_item(@{
170+
ast_map::node_item(@ast::item {
171171
node: ast::item_enum(enum_definition, _), _
172172
}, _) => {
173173
let ast_variant = option::get(
@@ -226,7 +226,7 @@ fn merge_method_attrs(
226226
// Create an assoc list from method name to attributes
227227
let attrs: ~[(~str, Option<~str>)] = do astsrv::exec(srv) |ctxt| {
228228
match ctxt.ast_map.get(item_id) {
229-
ast_map::node_item(@{
229+
ast_map::node_item(@ast::item {
230230
node: ast::item_trait(_, _, methods), _
231231
}, _) => {
232232
vec::map(methods, |method| {
@@ -240,7 +240,7 @@ fn merge_method_attrs(
240240
}
241241
})
242242
}
243-
ast_map::node_item(@{
243+
ast_map::node_item(@ast::item {
244244
node: ast::item_impl(_, _, _, methods), _
245245
}, _) => {
246246
vec::map(methods, |method| {

branches/try/src/librustdoc/tystr_pass.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn fold_fn(
6868
fn get_fn_sig(srv: astsrv::Srv, fn_id: doc::AstId) -> Option<~str> {
6969
do astsrv::exec(srv) |ctxt| {
7070
match ctxt.ast_map.get(fn_id) {
71-
ast_map::node_item(@{
71+
ast_map::node_item(@ast::item {
7272
ident: ident,
7373
node: ast::item_fn(decl, _, tys, _), _
7474
}, _) |
@@ -104,7 +104,7 @@ fn fold_const(
104104
{
105105
sig: Some(do astsrv::exec(srv) |ctxt| {
106106
match ctxt.ast_map.get(doc.id()) {
107-
ast_map::node_item(@{
107+
ast_map::node_item(@ast::item {
108108
node: ast::item_const(ty, _), _
109109
}, _) => {
110110
pprust::ty_to_str(ty, extract::interner())
@@ -134,7 +134,7 @@ fn fold_enum(
134134
let variant = *variant;
135135
let sig = do astsrv::exec(srv) |ctxt| {
136136
match ctxt.ast_map.get(doc_id) {
137-
ast_map::node_item(@{
137+
ast_map::node_item(@ast::item {
138138
node: ast::item_enum(enum_definition, _), _
139139
}, _) => {
140140
let ast_variant =
@@ -193,7 +193,7 @@ fn get_method_sig(
193193
) -> Option<~str> {
194194
do astsrv::exec(srv) |ctxt| {
195195
match ctxt.ast_map.get(item_id) {
196-
ast_map::node_item(@{
196+
ast_map::node_item(@ast::item {
197197
node: ast::item_trait(_, _, methods), _
198198
}, _) => {
199199
match vec::find(methods, |method| {
@@ -225,7 +225,7 @@ fn get_method_sig(
225225
_ => fail ~"method not found"
226226
}
227227
}
228-
ast_map::node_item(@{
228+
ast_map::node_item(@ast::item {
229229
node: ast::item_impl(_, _, _, methods), _
230230
}, _) => {
231231
match vec::find(methods, |method| {
@@ -263,7 +263,7 @@ fn fold_impl(
263263

264264
let (trait_types, self_ty) = do astsrv::exec(srv) |ctxt| {
265265
match ctxt.ast_map.get(doc.id()) {
266-
ast_map::node_item(@{
266+
ast_map::node_item(@ast::item {
267267
node: ast::item_impl(_, opt_trait_type, self_ty, _), _
268268
}, _) => {
269269
let trait_types = opt_trait_type.map_default(~[], |p| {
@@ -319,7 +319,7 @@ fn fold_type(
319319
{
320320
sig: do astsrv::exec(srv) |ctxt| {
321321
match ctxt.ast_map.get(doc.id()) {
322-
ast_map::node_item(@{
322+
ast_map::node_item(@ast::item {
323323
ident: ident,
324324
node: ast::item_ty(ty, params), _
325325
}, _) => {
@@ -380,7 +380,7 @@ fn strip_struct_extra_stuff(item: @ast::item) -> @ast::item {
380380
_ => fail ~"not a struct"
381381
};
382382

383-
@{
383+
@ast::item {
384384
attrs: ~[], // Remove the attributes
385385
node: node,
386386
.. *item

branches/try/src/libsyntax/ast.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,9 +1517,14 @@ type struct_def = {
15171517
*/
15181518
#[auto_encode]
15191519
#[auto_decode]
1520-
type item = {ident: ident, attrs: ~[attribute],
1521-
id: node_id, node: item_,
1522-
vis: visibility, span: span};
1520+
struct item {
1521+
ident: ident,
1522+
attrs: ~[attribute],
1523+
id: node_id,
1524+
node: item_,
1525+
vis: visibility,
1526+
span: span,
1527+
}
15231528

15241529
#[auto_encode]
15251530
#[auto_decode]

branches/try/src/libsyntax/ext/auto_encode.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ fn expand_auto_encode(
121121
}
122122

123123
fn filter_attrs(item: @ast::item) -> @ast::item {
124-
@{attrs: item.attrs.filtered(|a| !is_auto_encode(a)),
125-
.. *item}
124+
@ast::item {
125+
attrs: item.attrs.filtered(|a| !is_auto_encode(a)),
126+
.. *item
127+
}
126128
}
127129

128130
do vec::flat_map(in_items) |item| {
@@ -185,8 +187,10 @@ fn expand_auto_decode(
185187
}
186188

187189
fn filter_attrs(item: @ast::item) -> @ast::item {
188-
@{attrs: item.attrs.filtered(|a| !is_auto_decode(a)),
189-
.. *item}
190+
@ast::item {
191+
attrs: item.attrs.filtered(|a| !is_auto_decode(a)),
192+
.. *item
193+
}
190194
}
191195

192196
do vec::flat_map(in_items) |item| {
@@ -444,7 +448,7 @@ fn mk_impl(
444448
tps.map(|tp| cx.ty_path(span, ~[tp.ident], ~[]))
445449
);
446450

447-
@{
451+
@ast::item {
448452
// This is a new-style impl declaration.
449453
// XXX: clownshoes
450454
ident: parse::token::special_idents::clownshoes_extensions,

branches/try/src/libsyntax/ext/deriving.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ fn expand_deriving(cx: ext_ctxt,
111111
}
112112

113113
fn create_impl_item(cx: ext_ctxt, span: span, +item: item_) -> @item {
114-
@{
114+
@ast::item {
115115
ident: clownshoes_extensions,
116116
attrs: ~[],
117117
id: cx.next_id(),

branches/try/src/libsyntax/ext/pipes/ast_builder.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ impl ext_ctxt: ext_ctxt_ast_builder {
229229
is_sugared_doc: false
230230
});
231231

232-
@{ident: name,
233-
attrs: ~[non_camel_case_attribute],
234-
id: self.next_id(),
235-
node: node,
236-
vis: ast::public,
237-
span: span}
232+
@ast::item { ident: name,
233+
attrs: ~[non_camel_case_attribute],
234+
id: self.next_id(),
235+
node: node,
236+
vis: ast::public,
237+
span: span }
238238
}
239239

240240
fn item_fn_poly(name: ident,

0 commit comments

Comments
 (0)