From 2cfe8fb357f8ad7e99dc03b09e0ec5fa1c2c9029 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 31 Jul 2012 16:32:37 -0700 Subject: rustc: Check self types in method lookup; allow required trait methods to have self types; write self types into metadata --- src/libsyntax/ast.rs | 3 ++- src/libsyntax/parse/parser.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 8210f0734ac..6e56e5ca65a 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -503,7 +503,8 @@ type ty_field = spanned; #[auto_serialize] type ty_method = {ident: ident, attrs: ~[attribute], - decl: fn_decl, tps: ~[ty_param], span: span}; + decl: fn_decl, tps: ~[ty_param], self_ty: self_ty, + span: span}; #[auto_serialize] // A trait method is either required (meaning it doesn't have an diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 80cfd50ea3b..46a9f062645 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -286,6 +286,7 @@ class parser { // methods are ignored; this could change. required({ident: ident, attrs: attrs, decl: {purity: pur with d}, tps: tps, + self_ty: self_ty, span: mk_sp(lo, hi)}) } token::LBRACE { -- cgit 1.4.1-3-g733a5