@@ -25,6 +25,7 @@ use syntax::ast;
25
25
use syntax:: ast_util:: { local_def} ;
26
26
use syntax:: ast_util:: { walk_pat, trait_method_to_ty_method} ;
27
27
use syntax:: ext:: mtwt;
28
+ use syntax:: parse:: token:: special_names;
28
29
use syntax:: parse:: token:: special_idents;
29
30
use syntax:: parse:: token;
30
31
use syntax:: codemap:: { Span , DUMMY_SP , Pos } ;
@@ -830,9 +831,9 @@ struct Resolver<'a> {
830
831
current_self_type : Option < Ty > ,
831
832
832
833
// The ident for the keyword "self".
833
- self_ident : Ident ,
834
+ self_name : Name ,
834
835
// The ident for the non-keyword "Self".
835
- type_self_ident : Ident ,
836
+ type_self_name : Name ,
836
837
837
838
// The idents for the primitive types.
838
839
primitive_type_table : PrimitiveTypeTable ,
@@ -926,8 +927,8 @@ impl<'a> Resolver<'a> {
926
927
current_trait_ref : None ,
927
928
current_self_type : None ,
928
929
929
- self_ident : special_idents :: self_,
930
- type_self_ident : special_idents :: type_self,
930
+ self_name : special_names :: self_,
931
+ type_self_name : special_names :: type_self,
931
932
932
933
primitive_type_table : PrimitiveTypeTable :: new ( ) ,
933
934
@@ -3628,8 +3629,8 @@ impl<'a> Resolver<'a> {
3628
3629
// Create a new rib for the self type.
3629
3630
let self_type_rib = Rib :: new ( ItemRibKind ) ;
3630
3631
3631
- // plain insert (no renaming)
3632
- let name = self . type_self_ident . name ;
3632
+ // plain insert (no renaming, types are not currently hygienic.... )
3633
+ let name = self . type_self_name ;
3633
3634
self_type_rib. bindings . borrow_mut ( )
3634
3635
. insert ( name, DlDef ( DefSelfTy ( item. id ) ) ) ;
3635
3636
self . type_ribs . borrow_mut ( ) . push ( self_type_rib) ;
@@ -5159,8 +5160,8 @@ impl<'a> Resolver<'a> {
5159
5160
false // Stop advancing
5160
5161
} ) ;
5161
5162
5162
- if method_scope && token:: get_name ( self . self_ident . name ) . get ( )
5163
- == wrong_name. as_slice ( ) {
5163
+ if method_scope && token:: get_name ( self . self_name ) . get ( )
5164
+ == wrong_name. as_slice ( ) {
5164
5165
self . resolve_error (
5165
5166
expr. span ,
5166
5167
"`self` is not available \
@@ -5532,6 +5533,7 @@ impl<'a> Resolver<'a> {
5532
5533
collect_mod ( idents, & * module. upgrade ( ) . unwrap ( ) ) ;
5533
5534
}
5534
5535
BlockParentLink ( ref module, _) => {
5536
+ // danger, shouldn't be ident?
5535
5537
idents. push ( special_idents:: opaque) ;
5536
5538
collect_mod ( idents, & * module. upgrade ( ) . unwrap ( ) ) ;
5537
5539
}
0 commit comments