Skip to content

Commit 3a5c7f5

Browse files
committed
Change node_id to def_id in self_info.
1 parent 3ab4b01 commit 3a5c7f5

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/rustc/middle/typeck/check.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ import std::map::str_hash;
7979

8080
type self_info = {
8181
self_ty: ty::t,
82-
node_id: ast::node_id,
82+
def_id: ast::def_id,
8383
explicit_self: ast::self_ty_
8484
};
8585

@@ -401,7 +401,8 @@ fn check_struct(ccx: @crate_ctxt, struct_def: @ast::struct_def,
401401
let self_ty = ty::node_id_to_type(tcx, id);
402402

403403
do option::iter(struct_def.ctor) |ctor| {
404-
let class_t = {self_ty: self_ty, node_id: id,
404+
let class_t = {self_ty: self_ty,
405+
def_id: local_def(id),
405406
explicit_self: ast::sty_by_ref};
406407
// typecheck the ctor
407408
check_bare_fn(ccx, ctor.node.dec,
@@ -412,7 +413,8 @@ fn check_struct(ccx: @crate_ctxt, struct_def: @ast::struct_def,
412413
}
413414

414415
do option::iter(struct_def.dtor) |dtor| {
415-
let class_t = {self_ty: self_ty, node_id: id,
416+
let class_t = {self_ty: self_ty,
417+
def_id: local_def(id),
416418
explicit_self: ast::sty_by_ref};
417419
// typecheck the dtor
418420
check_bare_fn(ccx, ast_util::dtor_dec(),
@@ -424,7 +426,8 @@ fn check_struct(ccx: @crate_ctxt, struct_def: @ast::struct_def,
424426

425427
// typecheck the methods
426428
for struct_def.methods.each |m| {
427-
check_method(ccx, m, {self_ty: self_ty, node_id: id,
429+
check_method(ccx, m, {self_ty: self_ty,
430+
def_id: local_def(id),
428431
explicit_self: m.self_ty.node});
429432
}
430433
// Check that there's at least one field
@@ -450,7 +453,8 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
450453
*it.ident, it.id, rp};
451454
let self_ty = ccx.to_ty(rscope::type_rscope(rp), ty);
452455
for ms.each |m| {
453-
let self_info = {self_ty: self_ty, node_id: it.id,
456+
let self_info = {self_ty: self_ty,
457+
def_id: local_def(it.id),
454458
explicit_self: m.self_ty.node };
455459
check_method(ccx, m, self_info)
456460
}
@@ -464,7 +468,7 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
464468
}
465469
provided(m) => {
466470
let self_info = {self_ty: ty::mk_self(ccx.tcx),
467-
node_id: it.id,
471+
def_id: local_def(it.id),
468472
explicit_self: m.self_ty.node};
469473
check_method(ccx, m, self_info);
470474
}

src/rustc/middle/typeck/check/regionmanip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn replace_bound_regions_in_fn_ty(
5858
ty_to_str(tcx, t_fn)};
5959

6060

61-
// Glue updated self_ty back together with its original node_id.
61+
// Glue updated self_ty back together with its original def_id.
6262
let new_self_info = match self_info {
6363
some(s) => match check t_self {
6464
some(t) => some({self_ty: t with s})

0 commit comments

Comments
 (0)