@@ -29,7 +29,7 @@ use syntax::ast_util::{Privacy, Public, Private};
29
29
use syntax:: ast_util:: { variant_visibility_to_privacy, visibility_to_privacy} ;
30
30
use syntax:: attr;
31
31
use syntax:: parse:: token;
32
- use syntax:: parse:: token:: ident_interner;
32
+ use syntax:: parse:: token:: { ident_interner, interner_get } ;
33
33
use syntax:: parse:: token:: special_idents;
34
34
use syntax:: print:: pprust:: path_to_str;
35
35
use syntax:: codemap:: { Span , dummy_sp, BytePos } ;
@@ -311,7 +311,7 @@ pub enum DuplicateCheckingMode {
311
311
312
312
/// One local scope.
313
313
pub struct Rib {
314
- bindings : @mut HashMap < Ident , DefLike > ,
314
+ bindings : @mut HashMap < Name , DefLike > ,
315
315
self_binding : @mut Option < DefLike > ,
316
316
kind : RibKind ,
317
317
}
@@ -3508,7 +3508,7 @@ impl Resolver {
3508
3508
let mut i = ribs. len ( ) ;
3509
3509
while i != 0 {
3510
3510
i -= 1 ;
3511
- match ribs[ i] . bindings . find ( & name) {
3511
+ match ribs[ i] . bindings . find ( & name. name ) {
3512
3512
Some ( & def_like) => {
3513
3513
return self . upvarify ( ribs, i, def_like, span,
3514
3514
allow_capturing_self) ;
@@ -3591,7 +3591,7 @@ impl Resolver {
3591
3591
// Create a new rib for the self type.
3592
3592
let self_type_rib = @Rib :: new ( NormalRibKind ) ;
3593
3593
self . type_ribs . push ( self_type_rib) ;
3594
- self_type_rib. bindings . insert ( self . type_self_ident ,
3594
+ self_type_rib. bindings . insert ( self . type_self_ident . name ,
3595
3595
DlDef ( DefSelfTy ( item. id ) ) ) ;
3596
3596
3597
3597
// Create a new rib for the trait-wide type parameters.
@@ -3723,7 +3723,7 @@ impl Resolver {
3723
3723
self . type_ribs . push ( function_type_rib) ;
3724
3724
3725
3725
for ( index, type_parameter) in generics. ty_params . iter ( ) . enumerate ( ) {
3726
- let name = type_parameter. ident ;
3726
+ let ident = type_parameter. ident ;
3727
3727
debug ! ( "with_type_parameter_rib: %d %d" , node_id,
3728
3728
type_parameter. id) ;
3729
3729
let def_like = DlDef ( DefTyParam
@@ -3733,7 +3733,7 @@ impl Resolver {
3733
3733
// the item that bound it
3734
3734
self . record_def ( type_parameter. id ,
3735
3735
DefTyParamBinder ( node_id) ) ;
3736
- function_type_rib. bindings . insert ( name, def_like) ;
3736
+ function_type_rib. bindings . insert ( ident . name , def_like) ;
3737
3737
}
3738
3738
}
3739
3739
@@ -4370,7 +4370,7 @@ impl Resolver {
4370
4370
let this = & mut * self ;
4371
4371
let last_rib = this. value_ribs [
4372
4372
this. value_ribs . len ( ) - 1 ] ;
4373
- last_rib. bindings . insert ( ident,
4373
+ last_rib. bindings . insert ( ident. name ,
4374
4374
DlDef ( def) ) ;
4375
4375
bindings_list. insert ( ident, pat_id) ;
4376
4376
}
@@ -4391,7 +4391,7 @@ impl Resolver {
4391
4391
let this = & mut * self ;
4392
4392
let last_rib = this. value_ribs [
4393
4393
this. value_ribs . len ( ) - 1 ] ;
4394
- last_rib. bindings . insert ( ident,
4394
+ last_rib. bindings . insert ( ident. name ,
4395
4395
DlDef ( def) ) ;
4396
4396
}
4397
4397
}
@@ -4957,7 +4957,7 @@ impl Resolver {
4957
4957
while j != 0 {
4958
4958
j -= 1 ;
4959
4959
for ( & k, _) in this. value_ribs [ j] . bindings . iter ( ) {
4960
- maybes. push ( this . session . str_of ( k) ) ;
4960
+ maybes. push ( interner_get ( k) ) ;
4961
4961
values. push ( uint:: max_value) ;
4962
4962
}
4963
4963
}
@@ -5146,7 +5146,7 @@ impl Resolver {
5146
5146
let this = & mut * self ;
5147
5147
let def_like = DlDef ( DefLabel ( expr. id ) ) ;
5148
5148
let rib = this. label_ribs [ this. label_ribs . len ( ) - 1 ] ;
5149
- rib. bindings . insert ( label, def_like) ;
5149
+ rib. bindings . insert ( label. name , def_like) ;
5150
5150
}
5151
5151
5152
5152
visit:: walk_expr ( visitor, expr, ( ) ) ;
@@ -5554,3 +5554,4 @@ pub fn resolve_crate(session: Session,
5554
5554
trait_map : resolver. trait_map . clone ( ) ,
5555
5555
}
5556
5556
}
5557
+
0 commit comments