@@ -278,7 +278,7 @@ fn item_region_param_defs(item_doc: ebml::Doc, cdata: Cmd)
278
278
reader:: tagged_docs ( item_doc, tag_region_param_def, |rp_doc| {
279
279
let ident_str_doc = reader:: get_doc ( rp_doc,
280
280
tag_region_param_def_ident) ;
281
- let ident = item_name ( token:: get_ident_interner ( ) , ident_str_doc) ;
281
+ let ident = item_name ( & * token:: get_ident_interner ( ) , ident_str_doc) ;
282
282
let def_id_doc = reader:: get_doc ( rp_doc,
283
283
tag_region_param_def_def_id) ;
284
284
let def_id = reader:: with_doc_data ( def_id_doc, parse_def_id) ;
@@ -460,13 +460,13 @@ pub fn get_impl_vtables(cdata: Cmd,
460
460
}
461
461
462
462
463
- pub fn get_impl_method ( intr : @ IdentInterner , cdata : Cmd , id : ast:: NodeId ,
463
+ pub fn get_impl_method ( intr : Rc < IdentInterner > , cdata : Cmd , id : ast:: NodeId ,
464
464
name : ast:: Ident ) -> Option < ast:: DefId > {
465
465
let items = reader:: get_doc ( reader:: Doc ( cdata. data ( ) ) , tag_items) ;
466
466
let mut found = None ;
467
467
reader:: tagged_docs ( find_item ( id, items) , tag_item_impl_method, |mid| {
468
468
let m_did = reader:: with_doc_data ( mid, parse_def_id) ;
469
- if item_name ( intr, find_item ( m_did. node , items) ) == name {
469
+ if item_name ( & * intr, find_item ( m_did. node , items) ) == name {
470
470
found = Some ( translate_def_id ( cdata, m_did) ) ;
471
471
}
472
472
true
@@ -509,7 +509,7 @@ pub fn each_lang_item(cdata: Cmd, f: |ast::NodeId, uint| -> bool) -> bool {
509
509
} )
510
510
}
511
511
512
- fn each_child_of_item_or_crate ( intr : @ IdentInterner ,
512
+ fn each_child_of_item_or_crate ( intr : Rc < IdentInterner > ,
513
513
cdata : Cmd ,
514
514
item_doc : ebml:: Doc ,
515
515
get_crate_data : GetCrateDataCb ,
@@ -536,7 +536,7 @@ fn each_child_of_item_or_crate(intr: @IdentInterner,
536
536
None => { }
537
537
Some ( child_item_doc) => {
538
538
// Hand off the item to the callback.
539
- let child_name = item_name ( intr, child_item_doc) ;
539
+ let child_name = item_name ( & * intr, child_item_doc) ;
540
540
let def_like = item_to_def_like ( child_item_doc,
541
541
child_def_id,
542
542
cdata. cnum ) ;
@@ -577,7 +577,7 @@ fn each_child_of_item_or_crate(intr: @IdentInterner,
577
577
// Hand off the static method
578
578
// to the callback.
579
579
let static_method_name =
580
- item_name ( intr, impl_method_doc) ;
580
+ item_name ( & * intr, impl_method_doc) ;
581
581
let static_method_def_like =
582
582
item_to_def_like ( impl_method_doc,
583
583
impl_method_def_id,
@@ -638,7 +638,7 @@ fn each_child_of_item_or_crate(intr: @IdentInterner,
638
638
}
639
639
640
640
/// Iterates over each child of the given item.
641
- pub fn each_child_of_item ( intr : @ IdentInterner ,
641
+ pub fn each_child_of_item ( intr : Rc < IdentInterner > ,
642
642
cdata : Cmd ,
643
643
id : ast:: NodeId ,
644
644
get_crate_data : GetCrateDataCb ,
@@ -659,7 +659,7 @@ pub fn each_child_of_item(intr: @IdentInterner,
659
659
}
660
660
661
661
/// Iterates over all the top-level crate items.
662
- pub fn each_top_level_item_of_crate ( intr : @ IdentInterner ,
662
+ pub fn each_top_level_item_of_crate ( intr : Rc < IdentInterner > ,
663
663
cdata : Cmd ,
664
664
get_crate_data : GetCrateDataCb ,
665
665
callback : |DefLike ,
@@ -711,7 +711,7 @@ pub fn maybe_get_item_ast(cdata: Cmd, tcx: &ty::ctxt, id: ast::NodeId,
711
711
}
712
712
}
713
713
714
- pub fn get_enum_variants ( intr : @ IdentInterner , cdata : Cmd , id : ast:: NodeId ,
714
+ pub fn get_enum_variants ( intr : Rc < IdentInterner > , cdata : Cmd , id : ast:: NodeId ,
715
715
tcx : & ty:: ctxt ) -> Vec < @ty:: VariantInfo > {
716
716
let data = cdata. data ( ) ;
717
717
let items = reader:: get_doc ( reader:: Doc ( data) , tag_items) ;
@@ -723,7 +723,7 @@ pub fn get_enum_variants(intr: @IdentInterner, cdata: Cmd, id: ast::NodeId,
723
723
let item = find_item ( did. node , items) ;
724
724
let ctor_ty = item_type ( ast:: DefId { krate : cdata. cnum , node : id} ,
725
725
item, tcx, cdata) ;
726
- let name = item_name ( intr, item) ;
726
+ let name = item_name ( & * intr, item) ;
727
727
let arg_tys = match ty:: get ( ctor_ty) . sty {
728
728
ty:: ty_bare_fn( ref f) => f. sig . inputs . clone ( ) ,
729
729
_ => Vec :: new ( ) , // Nullary enum variant.
@@ -770,20 +770,20 @@ fn get_explicit_self(item: ebml::Doc) -> ast::ExplicitSelf_ {
770
770
}
771
771
}
772
772
773
- fn item_impl_methods ( intr : @ IdentInterner , cdata : Cmd , item : ebml:: Doc ,
773
+ fn item_impl_methods ( intr : Rc < IdentInterner > , cdata : Cmd , item : ebml:: Doc ,
774
774
tcx : & ty:: ctxt ) -> Vec < @ty:: Method > {
775
775
let mut rslt = Vec :: new ( ) ;
776
776
reader:: tagged_docs ( item, tag_item_impl_method, |doc| {
777
777
let m_did = reader:: with_doc_data ( doc, parse_def_id) ;
778
- rslt. push ( @get_method ( intr, cdata, m_did. node , tcx) ) ;
778
+ rslt. push ( @get_method ( intr. clone ( ) , cdata, m_did. node , tcx) ) ;
779
779
true
780
780
} ) ;
781
781
782
782
rslt
783
783
}
784
784
785
785
/// Returns information about the given implementation.
786
- pub fn get_impl ( intr : @ IdentInterner , cdata : Cmd , impl_id : ast:: NodeId ,
786
+ pub fn get_impl ( intr : Rc < IdentInterner > , cdata : Cmd , impl_id : ast:: NodeId ,
787
787
tcx : & ty:: ctxt )
788
788
-> ty:: Impl {
789
789
let data = cdata. data ( ) ;
@@ -793,23 +793,23 @@ pub fn get_impl(intr: @IdentInterner, cdata: Cmd, impl_id: ast::NodeId,
793
793
krate : cdata. cnum ,
794
794
node : impl_id,
795
795
} ,
796
- ident : item_name ( intr, impl_item) ,
796
+ ident : item_name ( & * intr, impl_item) ,
797
797
methods : item_impl_methods ( intr, cdata, impl_item, tcx) ,
798
798
}
799
799
}
800
800
801
801
pub fn get_method_name_and_explicit_self (
802
- intr : @ IdentInterner ,
802
+ intr : Rc < IdentInterner > ,
803
803
cdata : Cmd ,
804
804
id : ast:: NodeId ) -> ( ast:: Ident , ast:: ExplicitSelf_ )
805
805
{
806
806
let method_doc = lookup_item ( id, cdata. data ( ) ) ;
807
- let name = item_name ( intr, method_doc) ;
807
+ let name = item_name ( & * intr, method_doc) ;
808
808
let explicit_self = get_explicit_self ( method_doc) ;
809
809
( name, explicit_self)
810
810
}
811
811
812
- pub fn get_method ( intr : @ IdentInterner , cdata : Cmd , id : ast:: NodeId ,
812
+ pub fn get_method ( intr : Rc < IdentInterner > , cdata : Cmd , id : ast:: NodeId ,
813
813
tcx : & ty:: ctxt ) -> ty:: Method
814
814
{
815
815
let method_doc = lookup_item ( id, cdata. data ( ) ) ;
@@ -823,7 +823,7 @@ pub fn get_method(intr: @IdentInterner, cdata: Cmd, id: ast::NodeId,
823
823
_ => ImplContainer ( container_id) ,
824
824
} ;
825
825
826
- let name = item_name ( intr, method_doc) ;
826
+ let name = item_name ( & * intr, method_doc) ;
827
827
let type_param_defs = item_ty_param_defs ( method_doc, tcx, cdata,
828
828
tag_item_method_tps) ;
829
829
let rp_defs = item_region_param_defs ( method_doc, cdata) ;
@@ -867,7 +867,7 @@ pub fn get_item_variances(cdata: Cmd, id: ast::NodeId) -> ty::ItemVariances {
867
867
unwrap_ ( Decodable :: decode ( & mut decoder) )
868
868
}
869
869
870
- pub fn get_provided_trait_methods ( intr : @ IdentInterner , cdata : Cmd ,
870
+ pub fn get_provided_trait_methods ( intr : Rc < IdentInterner > , cdata : Cmd ,
871
871
id : ast:: NodeId , tcx : & ty:: ctxt ) ->
872
872
Vec < @ty:: Method > {
873
873
let data = cdata. data ( ) ;
@@ -879,7 +879,7 @@ pub fn get_provided_trait_methods(intr: @IdentInterner, cdata: Cmd,
879
879
let mth = lookup_item ( did. node , data) ;
880
880
881
881
if item_method_sort ( mth) == 'p' {
882
- result. push ( @get_method ( intr, cdata, did. node , tcx) ) ;
882
+ result. push ( @get_method ( intr. clone ( ) , cdata, did. node , tcx) ) ;
883
883
}
884
884
true
885
885
} ) ;
@@ -921,7 +921,7 @@ pub fn get_type_name_if_impl(cdata: Cmd,
921
921
ret
922
922
}
923
923
924
- pub fn get_static_methods_if_impl ( intr : @ IdentInterner ,
924
+ pub fn get_static_methods_if_impl ( intr : Rc < IdentInterner > ,
925
925
cdata : Cmd ,
926
926
node_id : ast:: NodeId )
927
927
-> Option < Vec < StaticMethodInfo > > {
@@ -957,7 +957,7 @@ pub fn get_static_methods_if_impl(intr: @IdentInterner,
957
957
}
958
958
959
959
static_impl_methods. push ( StaticMethodInfo {
960
- ident : item_name ( intr, impl_method_doc) ,
960
+ ident : item_name ( & * intr, impl_method_doc) ,
961
961
def_id : item_def_id ( impl_method_doc, cdata) ,
962
962
purity : purity,
963
963
vis : item_visibility ( impl_method_doc) ,
@@ -1009,7 +1009,7 @@ fn struct_field_family_to_visibility(family: Family) -> ast::Visibility {
1009
1009
}
1010
1010
}
1011
1011
1012
- pub fn get_struct_fields ( intr : @ IdentInterner , cdata : Cmd , id : ast:: NodeId )
1012
+ pub fn get_struct_fields ( intr : Rc < IdentInterner > , cdata : Cmd , id : ast:: NodeId )
1013
1013
-> Vec < ty:: field_ty > {
1014
1014
let data = cdata. data ( ) ;
1015
1015
let item = lookup_item ( id, data) ;
@@ -1018,7 +1018,7 @@ pub fn get_struct_fields(intr: @IdentInterner, cdata: Cmd, id: ast::NodeId)
1018
1018
let f = item_family ( an_item) ;
1019
1019
if f == PublicField || f == PrivateField || f == InheritedField {
1020
1020
// FIXME #6993: name should be of type Name, not Ident
1021
- let name = item_name ( intr, an_item) ;
1021
+ let name = item_name ( & * intr, an_item) ;
1022
1022
let did = item_def_id ( an_item, cdata) ;
1023
1023
result. push ( ty:: field_ty {
1024
1024
name : name. name ,
0 commit comments