1
Fork 0

carry self ident forward through re-parsing

formerly, the self identifier was being discarded during parsing, which
stymies hygiene. The best fix here seems to be to attach a self identifier
to ExplicitSelf_, a change that rippled through the rest of the compiler,
but without any obvious damage.
This commit is contained in:
John Clements 2014-07-06 15:10:57 -07:00
parent 69c27546ee
commit 19e718b34d
15 changed files with 114 additions and 80 deletions

View file

@ -191,6 +191,7 @@ use codemap;
use codemap::Span;
use owned_slice::OwnedSlice;
use parse::token::InternedString;
use parse::token::special_idents;
use self::ty::*;
@ -617,7 +618,8 @@ impl<'a> MethodDef<'a> {
let self_arg = match explicit_self.node {
ast::SelfStatic => None,
_ => Some(ast::Arg::new_self(trait_.span, ast::MutImmutable))
// creating fresh self id
_ => Some(ast::Arg::new_self(trait_.span, ast::MutImmutable, special_idents::self_))
};
let args = {
let args = arg_types.move_iter().map(|(name, ty)| {