@@ -84,7 +84,7 @@ pub trait AstConv<'gcx, 'tcx> {
84
84
}
85
85
86
86
struct ConvertedBinding < ' tcx > {
87
- item_name : ast:: Name ,
87
+ item_name : ast:: Ident ,
88
88
ty : Ty < ' tcx > ,
89
89
span : Span ,
90
90
}
@@ -333,7 +333,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
333
333
334
334
let assoc_bindings = parameters. bindings . iter ( ) . map ( |binding| {
335
335
ConvertedBinding {
336
- item_name : binding. name ,
336
+ item_name : binding. ident ,
337
337
ty : self . ast_ty_to_ty ( & binding. ty ) ,
338
338
span : binding. span ,
339
339
}
@@ -475,12 +475,12 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
475
475
476
476
fn trait_defines_associated_type_named ( & self ,
477
477
trait_def_id : DefId ,
478
- assoc_name : ast:: Name )
478
+ assoc_name : ast:: Ident )
479
479
-> bool
480
480
{
481
481
self . tcx ( ) . associated_items ( trait_def_id) . any ( |item| {
482
482
item. kind == ty:: AssociatedKind :: Type &&
483
- self . tcx ( ) . hygienic_eq ( assoc_name, item. name , trait_def_id)
483
+ self . tcx ( ) . hygienic_eq ( assoc_name, item. name . to_ident ( ) , trait_def_id)
484
484
} )
485
485
}
486
486
@@ -559,7 +559,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
559
559
} ?;
560
560
561
561
let ( assoc_ident, def_scope) =
562
- tcx. adjust_ident ( binding. item_name . to_ident ( ) , candidate. def_id ( ) , ref_id) ;
562
+ tcx. adjust_ident ( binding. item_name , candidate. def_id ( ) , ref_id) ;
563
563
let assoc_ty = tcx. associated_items ( candidate. def_id ( ) ) . find ( |i| {
564
564
i. kind == ty:: AssociatedKind :: Type && i. name . to_ident ( ) == assoc_ident
565
565
} ) . expect ( "missing associated type" ) ;
@@ -768,7 +768,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
768
768
// any ambiguity.
769
769
fn find_bound_for_assoc_item ( & self ,
770
770
ty_param_def_id : DefId ,
771
- assoc_name : ast:: Name ,
771
+ assoc_name : ast:: Ident ,
772
772
span : Span )
773
773
-> Result < ty:: PolyTraitRef < ' tcx > , ErrorReported >
774
774
{
@@ -797,7 +797,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
797
797
fn one_bound_for_assoc_type < I > ( & self ,
798
798
mut bounds : I ,
799
799
ty_param_name : & str ,
800
- assoc_name : ast:: Name ,
800
+ assoc_name : ast:: Ident ,
801
801
span : Span )
802
802
-> Result < ty:: PolyTraitRef < ' tcx > , ErrorReported >
803
803
where I : Iterator < Item =ty:: PolyTraitRef < ' tcx > >
@@ -827,7 +827,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
827
827
for bound in bounds {
828
828
let bound_span = self . tcx ( ) . associated_items ( bound. def_id ( ) ) . find ( |item| {
829
829
item. kind == ty:: AssociatedKind :: Type &&
830
- self . tcx ( ) . hygienic_eq ( assoc_name, item. name , bound. def_id ( ) )
830
+ self . tcx ( ) . hygienic_eq ( assoc_name, item. name . to_ident ( ) , bound. def_id ( ) )
831
831
} )
832
832
. and_then ( |item| self . tcx ( ) . hir . span_if_local ( item. def_id ) ) ;
833
833
@@ -863,7 +863,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
863
863
-> ( Ty < ' tcx > , Def )
864
864
{
865
865
let tcx = self . tcx ( ) ;
866
- let assoc_name = item_segment. name ;
866
+ let assoc_name = item_segment. name . to_ident ( ) ;
867
867
868
868
debug ! ( "associated_path_def_to_ty: {:?}::{}" , ty, assoc_name) ;
869
869
@@ -885,8 +885,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
885
885
886
886
let candidates =
887
887
traits:: supertraits ( tcx, ty:: Binder :: bind ( trait_ref) )
888
- . filter ( |r| self . trait_defines_associated_type_named ( r. def_id ( ) ,
889
- assoc_name) ) ;
888
+ . filter ( |r| self . trait_defines_associated_type_named ( r. def_id ( ) , assoc_name) ) ;
890
889
891
890
match self . one_bound_for_assoc_type ( candidates, "Self" , assoc_name, span) {
892
891
Ok ( bound) => bound,
@@ -913,7 +912,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
913
912
} ;
914
913
915
914
let trait_did = bound. def_id ( ) ;
916
- let ( assoc_ident, def_scope) = tcx. adjust_ident ( assoc_name. to_ident ( ) , trait_did, ref_id) ;
915
+ let ( assoc_ident, def_scope) = tcx. adjust_ident ( assoc_name, trait_did, ref_id) ;
917
916
let item = tcx. associated_items ( trait_did) . find ( |i| {
918
917
Namespace :: from ( i. kind ) == Namespace :: Type &&
919
918
i. name . to_ident ( ) == assoc_ident
0 commit comments