From 07a81ad12e5cb7f84138af6624f30c5dbb75512f Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Tue, 26 Jun 2012 16:25:52 -0700 Subject: Refactor how impl self types are stored In order to avoid a confusing use of the tcache, I added an extra node ID field to trait refs. Now trait refs have a "ref ID" (the one that resolve3 resolves) and an "impl ID" (the one that you look up in the tcache to get the self type). Closes #2434 --- src/libsyntax/parse/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 5a1eb7636ba..7448f246698 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2189,7 +2189,7 @@ class parser { if option::is_none(ident) { ident = some(vec::last(path.idents)); } - some(@{path: path, id: self.get_id()}) + some(@{path: path, ref_id: self.get_id(), impl_id: self.get_id()}) } else { none }; let ident = alt ident { some(name) { name } @@ -2223,7 +2223,7 @@ class parser { fn parse_trait_ref() -> @trait_ref { @{path: self.parse_path_with_tps(false), - id: self.get_id()} + ref_id: self.get_id(), impl_id: self.get_id()} } fn parse_trait_ref_list() -> ~[@trait_ref] { -- cgit 1.4.1-3-g733a5