Skip to content

Commit d252d81

Browse files
committed
auto merge of #8939 : Kimundi/rust/master, r=huonw
2 parents 8183c74 + 7419085 commit d252d81

Some content is hidden

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

114 files changed

+3808
-3803
lines changed

src/librustc/front/config.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ fn fold_item_underscore(cx: @Context, item: &ast::item_,
116116
fold::noop_fold_item_underscore(&item, fld)
117117
}
118118

119-
fn filter_stmt(cx: @Context, stmt: @ast::stmt) ->
120-
Option<@ast::stmt> {
119+
fn filter_stmt(cx: @Context, stmt: @ast::Stmt) ->
120+
Option<@ast::Stmt> {
121121
match stmt.node {
122-
ast::stmt_decl(decl, _) => {
122+
ast::StmtDecl(decl, _) => {
123123
match decl.node {
124-
ast::decl_item(item) => {
124+
ast::DeclItem(item) => {
125125
if item_in_cfg(cx, item) {
126126
option::Some(stmt)
127127
} else { option::None }

src/librustc/front/test.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -441,29 +441,29 @@ fn is_extra(cx: &TestCtxt) -> bool {
441441
}
442442
}
443443

444-
fn mk_test_descs(cx: &TestCtxt) -> @ast::expr {
444+
fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr {
445445
debug!("building test vector from %u tests", cx.testfns.len());
446446
let mut descs = ~[];
447447
for test in cx.testfns.iter() {
448448
descs.push(mk_test_desc_and_fn_rec(cx, test));
449449
}
450450

451451
let sess = cx.sess;
452-
let inner_expr = @ast::expr {
452+
let inner_expr = @ast::Expr {
453453
id: sess.next_node_id(),
454-
node: ast::expr_vec(descs, ast::m_imm),
454+
node: ast::ExprVec(descs, ast::MutImmutable),
455455
span: dummy_sp(),
456456
};
457457

458-
@ast::expr {
458+
@ast::Expr {
459459
id: sess.next_node_id(),
460-
node: ast::expr_vstore(inner_expr, ast::expr_vstore_slice),
460+
node: ast::ExprVstore(inner_expr, ast::ExprVstoreSlice),
461461
span: dummy_sp(),
462462
}
463463
}
464464

465465
#[cfg(stage0)]
466-
fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::expr {
466+
fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::Expr {
467467
let span = test.span;
468468
let path = test.path.clone();
469469

@@ -474,17 +474,17 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::expr {
474474
let name_lit: ast::lit =
475475
nospan(ast::lit_str(ast_util::path_name_i(path).to_managed()));
476476

477-
let name_expr = @ast::expr {
477+
let name_expr = @ast::Expr {
478478
id: cx.sess.next_node_id(),
479-
node: ast::expr_lit(@name_lit),
479+
node: ast::ExprLit(@name_lit),
480480
span: span
481481
};
482482

483483
let fn_path = path_node_global(path);
484484

485-
let fn_expr = @ast::expr {
485+
let fn_expr = @ast::Expr {
486486
id: cx.sess.next_node_id(),
487-
node: ast::expr_path(fn_path),
487+
node: ast::ExprPath(fn_path),
488488
span: span,
489489
};
490490

@@ -519,7 +519,7 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::expr {
519519
e
520520
}
521521
#[cfg(not(stage0))]
522-
fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::expr {
522+
fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::Expr {
523523
let span = test.span;
524524
let path = test.path.clone();
525525

@@ -528,17 +528,17 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::expr {
528528
let name_lit: ast::lit =
529529
nospan(ast::lit_str(ast_util::path_name_i(path).to_managed()));
530530

531-
let name_expr = @ast::expr {
531+
let name_expr = @ast::Expr {
532532
id: cx.sess.next_node_id(),
533-
node: ast::expr_lit(@name_lit),
533+
node: ast::ExprLit(@name_lit),
534534
span: span
535535
};
536536

537537
let fn_path = path_node_global(path);
538538

539-
let fn_expr = @ast::expr {
539+
let fn_expr = @ast::Expr {
540540
id: cx.sess.next_node_id(),
541-
node: ast::expr_path(fn_path),
541+
node: ast::ExprPath(fn_path),
542542
span: span,
543543
};
544544

src/librustc/metadata/csearch.rs

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ use syntax::diagnostic::expect;
2626

2727
pub struct StaticMethodInfo {
2828
ident: ast::Ident,
29-
def_id: ast::def_id,
29+
def_id: ast::DefId,
3030
purity: ast::purity
3131
}
3232

33-
pub fn get_symbol(cstore: @mut cstore::CStore, def: ast::def_id) -> ~str {
33+
pub fn get_symbol(cstore: @mut cstore::CStore, def: ast::DefId) -> ~str {
3434
let cdata = cstore::get_crate_data(cstore, def.crate).data;
3535
return decoder::get_symbol(cdata, def.node);
3636
}
3737

38-
pub fn get_type_param_count(cstore: @mut cstore::CStore, def: ast::def_id)
38+
pub fn get_type_param_count(cstore: @mut cstore::CStore, def: ast::DefId)
3939
-> uint {
4040
let cdata = cstore::get_crate_data(cstore, def.crate).data;
4141
return decoder::get_type_param_count(cdata, def.node);
@@ -51,7 +51,7 @@ pub fn each_lang_item(cstore: @mut cstore::CStore,
5151

5252
/// Iterates over each child of the given item.
5353
pub fn each_child_of_item(cstore: @mut cstore::CStore,
54-
def_id: ast::def_id,
54+
def_id: ast::DefId,
5555
callback: &fn(decoder::DefLike, ast::Ident)) {
5656
let crate_data = cstore::get_crate_data(cstore, def_id.crate);
5757
let get_crate_data: decoder::GetCrateDataCb = |cnum| {
@@ -79,7 +79,7 @@ pub fn each_top_level_item_of_crate(cstore: @mut cstore::CStore,
7979
callback)
8080
}
8181

82-
pub fn get_item_path(tcx: ty::ctxt, def: ast::def_id) -> ast_map::path {
82+
pub fn get_item_path(tcx: ty::ctxt, def: ast::DefId) -> ast_map::path {
8383
let cstore = tcx.cstore;
8484
let cdata = cstore::get_crate_data(cstore, def.crate);
8585
let path = decoder::get_item_path(cdata, def.node);
@@ -92,14 +92,14 @@ pub fn get_item_path(tcx: ty::ctxt, def: ast::def_id) -> ast_map::path {
9292

9393
pub enum found_ast {
9494
found(ast::inlined_item),
95-
found_parent(ast::def_id, ast::inlined_item),
95+
found_parent(ast::DefId, ast::inlined_item),
9696
not_found,
9797
}
9898

9999
// Finds the AST for this item in the crate metadata, if any. If the item was
100100
// not marked for inlining, then the AST will not be present and hence none
101101
// will be returned.
102-
pub fn maybe_get_item_ast(tcx: ty::ctxt, def: ast::def_id,
102+
pub fn maybe_get_item_ast(tcx: ty::ctxt, def: ast::DefId,
103103
decode_inlined_item: decoder::decode_inlined_item)
104104
-> found_ast {
105105
let cstore = tcx.cstore;
@@ -108,102 +108,102 @@ pub fn maybe_get_item_ast(tcx: ty::ctxt, def: ast::def_id,
108108
decode_inlined_item)
109109
}
110110

111-
pub fn get_enum_variants(tcx: ty::ctxt, def: ast::def_id)
111+
pub fn get_enum_variants(tcx: ty::ctxt, def: ast::DefId)
112112
-> ~[@ty::VariantInfo] {
113113
let cstore = tcx.cstore;
114114
let cdata = cstore::get_crate_data(cstore, def.crate);
115115
return decoder::get_enum_variants(cstore.intr, cdata, def.node, tcx)
116116
}
117117

118118
/// Returns information about the given implementation.
119-
pub fn get_impl(tcx: ty::ctxt, impl_def_id: ast::def_id)
119+
pub fn get_impl(tcx: ty::ctxt, impl_def_id: ast::DefId)
120120
-> ty::Impl {
121121
let cdata = cstore::get_crate_data(tcx.cstore, impl_def_id.crate);
122122
decoder::get_impl(tcx.cstore.intr, cdata, impl_def_id.node, tcx)
123123
}
124124

125-
pub fn get_method(tcx: ty::ctxt, def: ast::def_id) -> ty::Method {
125+
pub fn get_method(tcx: ty::ctxt, def: ast::DefId) -> ty::Method {
126126
let cdata = cstore::get_crate_data(tcx.cstore, def.crate);
127127
decoder::get_method(tcx.cstore.intr, cdata, def.node, tcx)
128128
}
129129

130130
pub fn get_method_name_and_explicit_self(cstore: @mut cstore::CStore,
131-
def: ast::def_id)
131+
def: ast::DefId)
132132
-> (ast::Ident, ast::explicit_self_)
133133
{
134134
let cdata = cstore::get_crate_data(cstore, def.crate);
135135
decoder::get_method_name_and_explicit_self(cstore.intr, cdata, def.node)
136136
}
137137

138138
pub fn get_trait_method_def_ids(cstore: @mut cstore::CStore,
139-
def: ast::def_id) -> ~[ast::def_id] {
139+
def: ast::DefId) -> ~[ast::DefId] {
140140
let cdata = cstore::get_crate_data(cstore, def.crate);
141141
decoder::get_trait_method_def_ids(cdata, def.node)
142142
}
143143

144144
pub fn get_provided_trait_methods(tcx: ty::ctxt,
145-
def: ast::def_id)
145+
def: ast::DefId)
146146
-> ~[@ty::Method] {
147147
let cstore = tcx.cstore;
148148
let cdata = cstore::get_crate_data(cstore, def.crate);
149149
decoder::get_provided_trait_methods(cstore.intr, cdata, def.node, tcx)
150150
}
151151

152-
pub fn get_supertraits(tcx: ty::ctxt, def: ast::def_id) -> ~[@ty::TraitRef] {
152+
pub fn get_supertraits(tcx: ty::ctxt, def: ast::DefId) -> ~[@ty::TraitRef] {
153153
let cstore = tcx.cstore;
154154
let cdata = cstore::get_crate_data(cstore, def.crate);
155155
decoder::get_supertraits(cdata, def.node, tcx)
156156
}
157157

158-
pub fn get_type_name_if_impl(cstore: @mut cstore::CStore, def: ast::def_id)
158+
pub fn get_type_name_if_impl(cstore: @mut cstore::CStore, def: ast::DefId)
159159
-> Option<ast::Ident> {
160160
let cdata = cstore::get_crate_data(cstore, def.crate);
161161
decoder::get_type_name_if_impl(cdata, def.node)
162162
}
163163

164164
pub fn get_static_methods_if_impl(cstore: @mut cstore::CStore,
165-
def: ast::def_id)
165+
def: ast::DefId)
166166
-> Option<~[StaticMethodInfo]> {
167167
let cdata = cstore::get_crate_data(cstore, def.crate);
168168
decoder::get_static_methods_if_impl(cstore.intr, cdata, def.node)
169169
}
170170

171171
pub fn get_item_attrs(cstore: @mut cstore::CStore,
172-
def_id: ast::def_id,
172+
def_id: ast::DefId,
173173
f: &fn(~[@ast::MetaItem])) {
174174
let cdata = cstore::get_crate_data(cstore, def_id.crate);
175175
decoder::get_item_attrs(cdata, def_id.node, f)
176176
}
177177

178178
pub fn get_struct_fields(cstore: @mut cstore::CStore,
179-
def: ast::def_id)
179+
def: ast::DefId)
180180
-> ~[ty::field_ty] {
181181
let cdata = cstore::get_crate_data(cstore, def.crate);
182182
decoder::get_struct_fields(cstore.intr, cdata, def.node)
183183
}
184184

185185
pub fn get_type(tcx: ty::ctxt,
186-
def: ast::def_id)
186+
def: ast::DefId)
187187
-> ty::ty_param_bounds_and_ty {
188188
let cstore = tcx.cstore;
189189
let cdata = cstore::get_crate_data(cstore, def.crate);
190190
decoder::get_type(cdata, def.node, tcx)
191191
}
192192

193-
pub fn get_trait_def(tcx: ty::ctxt, def: ast::def_id) -> ty::TraitDef {
193+
pub fn get_trait_def(tcx: ty::ctxt, def: ast::DefId) -> ty::TraitDef {
194194
let cstore = tcx.cstore;
195195
let cdata = cstore::get_crate_data(cstore, def.crate);
196196
decoder::get_trait_def(cdata, def.node, tcx)
197197
}
198198

199199
pub fn get_region_param(cstore: @mut metadata::cstore::CStore,
200-
def: ast::def_id) -> Option<ty::region_variance> {
200+
def: ast::DefId) -> Option<ty::region_variance> {
201201
let cdata = cstore::get_crate_data(cstore, def.crate);
202202
return decoder::get_region_param(cdata, def.node);
203203
}
204204

205-
pub fn get_field_type(tcx: ty::ctxt, class_id: ast::def_id,
206-
def: ast::def_id) -> ty::ty_param_bounds_and_ty {
205+
pub fn get_field_type(tcx: ty::ctxt, class_id: ast::DefId,
206+
def: ast::DefId) -> ty::ty_param_bounds_and_ty {
207207
let cstore = tcx.cstore;
208208
let cdata = cstore::get_crate_data(cstore, class_id.crate);
209209
let all_items = reader::get_doc(reader::Doc(cdata.data), tag_items);
@@ -229,30 +229,30 @@ pub fn get_field_type(tcx: ty::ctxt, class_id: ast::def_id,
229229
// Given a def_id for an impl, return the trait it implements,
230230
// if there is one.
231231
pub fn get_impl_trait(tcx: ty::ctxt,
232-
def: ast::def_id) -> Option<@ty::TraitRef> {
232+
def: ast::DefId) -> Option<@ty::TraitRef> {
233233
let cstore = tcx.cstore;
234234
let cdata = cstore::get_crate_data(cstore, def.crate);
235235
decoder::get_impl_trait(cdata, def.node, tcx)
236236
}
237237

238238
// Given a def_id for an impl, return information about its vtables
239239
pub fn get_impl_vtables(tcx: ty::ctxt,
240-
def: ast::def_id) -> typeck::impl_res {
240+
def: ast::DefId) -> typeck::impl_res {
241241
let cstore = tcx.cstore;
242242
let cdata = cstore::get_crate_data(cstore, def.crate);
243243
decoder::get_impl_vtables(cdata, def.node, tcx)
244244
}
245245

246246
pub fn get_impl_method(cstore: @mut cstore::CStore,
247-
def: ast::def_id,
247+
def: ast::DefId,
248248
mname: ast::Ident)
249-
-> Option<ast::def_id> {
249+
-> Option<ast::DefId> {
250250
let cdata = cstore::get_crate_data(cstore, def.crate);
251251
decoder::get_impl_method(cstore.intr, cdata, def.node, mname)
252252
}
253253

254254
pub fn get_item_visibility(cstore: @mut cstore::CStore,
255-
def_id: ast::def_id)
255+
def_id: ast::DefId)
256256
-> ast::visibility {
257257
let cdata = cstore::get_crate_data(cstore, def_id.crate);
258258
decoder::get_item_visibility(cdata, def_id.node)
@@ -267,21 +267,21 @@ pub fn get_link_args_for_crate(cstore: @mut cstore::CStore,
267267

268268
pub fn each_impl(cstore: @mut cstore::CStore,
269269
crate_num: ast::CrateNum,
270-
callback: &fn(ast::def_id)) {
270+
callback: &fn(ast::DefId)) {
271271
let cdata = cstore::get_crate_data(cstore, crate_num);
272272
decoder::each_impl(cdata, callback)
273273
}
274274

275275
pub fn each_implementation_for_type(cstore: @mut cstore::CStore,
276-
def_id: ast::def_id,
277-
callback: &fn(ast::def_id)) {
276+
def_id: ast::DefId,
277+
callback: &fn(ast::DefId)) {
278278
let cdata = cstore::get_crate_data(cstore, def_id.crate);
279279
decoder::each_implementation_for_type(cdata, def_id.node, callback)
280280
}
281281

282282
pub fn each_implementation_for_trait(cstore: @mut cstore::CStore,
283-
def_id: ast::def_id,
284-
callback: &fn(ast::def_id)) {
283+
def_id: ast::DefId,
284+
callback: &fn(ast::DefId)) {
285285
let cdata = cstore::get_crate_data(cstore, def_id.crate);
286286
decoder::each_implementation_for_trait(cdata, def_id.node, callback)
287287
}
@@ -290,9 +290,9 @@ pub fn each_implementation_for_trait(cstore: @mut cstore::CStore,
290290
/// default method or an implementation of a trait method), returns the ID of
291291
/// the trait that the method belongs to. Otherwise, returns `None`.
292292
pub fn get_trait_of_method(cstore: @mut cstore::CStore,
293-
def_id: ast::def_id,
293+
def_id: ast::DefId,
294294
tcx: ty::ctxt)
295-
-> Option<ast::def_id> {
295+
-> Option<ast::DefId> {
296296
let cdata = cstore::get_crate_data(cstore, def_id.crate);
297297
decoder::get_trait_of_method(cdata, def_id.node, tcx)
298298
}

0 commit comments

Comments
 (0)