diff options
| author | Lindsey Kuper <lindsey@rockstargirl.org> | 2012-08-17 10:20:37 -0700 |
|---|---|---|
| committer | Lindsey Kuper <lindsey@rockstargirl.org> | 2012-08-17 11:04:53 -0700 |
| commit | 3a5c7f52cc089214c936f409b3f97d6bda377d84 (patch) | |
| tree | fb51146f78574ad90af315618526559aacb3fc85 | |
| parent | 3ab4b014cfaf6dff5b450f4a1772e9993550fe38 (diff) | |
Change node_id to def_id in self_info.
| -rw-r--r-- | src/rustc/middle/typeck/check.rs | 16 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/check/regionmanip.rs | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/rustc/middle/typeck/check.rs b/src/rustc/middle/typeck/check.rs index d29476a1fdd..3c7b6de7702 100644 --- a/src/rustc/middle/typeck/check.rs +++ b/src/rustc/middle/typeck/check.rs @@ -79,7 +79,7 @@ import std::map::str_hash; type self_info = { self_ty: ty::t, - node_id: ast::node_id, + def_id: ast::def_id, explicit_self: ast::self_ty_ }; @@ -401,7 +401,8 @@ fn check_struct(ccx: @crate_ctxt, struct_def: @ast::struct_def, let self_ty = ty::node_id_to_type(tcx, id); do option::iter(struct_def.ctor) |ctor| { - let class_t = {self_ty: self_ty, node_id: id, + let class_t = {self_ty: self_ty, + def_id: local_def(id), explicit_self: ast::sty_by_ref}; // typecheck the ctor check_bare_fn(ccx, ctor.node.dec, @@ -412,7 +413,8 @@ fn check_struct(ccx: @crate_ctxt, struct_def: @ast::struct_def, } do option::iter(struct_def.dtor) |dtor| { - let class_t = {self_ty: self_ty, node_id: id, + let class_t = {self_ty: self_ty, + def_id: local_def(id), explicit_self: ast::sty_by_ref}; // typecheck the dtor check_bare_fn(ccx, ast_util::dtor_dec(), @@ -424,7 +426,8 @@ fn check_struct(ccx: @crate_ctxt, struct_def: @ast::struct_def, // typecheck the methods for struct_def.methods.each |m| { - check_method(ccx, m, {self_ty: self_ty, node_id: id, + check_method(ccx, m, {self_ty: self_ty, + def_id: local_def(id), explicit_self: m.self_ty.node}); } // Check that there's at least one field @@ -450,7 +453,8 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) { *it.ident, it.id, rp}; let self_ty = ccx.to_ty(rscope::type_rscope(rp), ty); for ms.each |m| { - let self_info = {self_ty: self_ty, node_id: it.id, + let self_info = {self_ty: self_ty, + def_id: local_def(it.id), explicit_self: m.self_ty.node }; check_method(ccx, m, self_info) } @@ -464,7 +468,7 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) { } provided(m) => { let self_info = {self_ty: ty::mk_self(ccx.tcx), - node_id: it.id, + def_id: local_def(it.id), explicit_self: m.self_ty.node}; check_method(ccx, m, self_info); } diff --git a/src/rustc/middle/typeck/check/regionmanip.rs b/src/rustc/middle/typeck/check/regionmanip.rs index 75f5ca3cbd8..8cbc9e65d8e 100644 --- a/src/rustc/middle/typeck/check/regionmanip.rs +++ b/src/rustc/middle/typeck/check/regionmanip.rs @@ -58,7 +58,7 @@ fn replace_bound_regions_in_fn_ty( ty_to_str(tcx, t_fn)}; - // Glue updated self_ty back together with its original node_id. + // Glue updated self_ty back together with its original def_id. let new_self_info = match self_info { some(s) => match check t_self { some(t) => some({self_ty: t with s}) |
