@@ -650,12 +650,12 @@ pub fn normalize_and_test_predicates<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
650
650
/// Given a trait `trait_ref`, iterates the vtable entries
651
651
/// that come from `trait_ref`, including its supertraits.
652
652
#[ inline] // FIXME(#35870) Avoid closures being unexported due to impl Trait.
653
- pub fn get_vtable_methods < ' a , ' tcx > (
653
+ pub fn vtable_methods < ' a , ' tcx > (
654
654
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
655
655
trait_ref : ty:: PolyTraitRef < ' tcx > )
656
656
-> Vec < Option < ( DefId , & ' tcx Substs < ' tcx > ) > >
657
657
{
658
- debug ! ( "get_vtable_methods ({:?})" , trait_ref) ;
658
+ debug ! ( "vtable_methods ({:?})" , trait_ref) ;
659
659
660
660
supertraits ( tcx, trait_ref) . flat_map ( move |trait_ref| {
661
661
let trait_methods = tcx. associated_items ( trait_ref. def_id ( ) )
@@ -664,12 +664,12 @@ pub fn get_vtable_methods<'a, 'tcx>(
664
664
// Now list each method's DefId and Substs (for within its trait).
665
665
// If the method can never be called from this object, produce None.
666
666
trait_methods. map ( move |trait_method| {
667
- debug ! ( "get_vtable_methods : trait_method={:?}" , trait_method) ;
667
+ debug ! ( "vtable_methods : trait_method={:?}" , trait_method) ;
668
668
let def_id = trait_method. def_id ;
669
669
670
670
// Some methods cannot be called on an object; skip those.
671
671
if !tcx. is_vtable_safe_method ( trait_ref. def_id ( ) , & trait_method) {
672
- debug ! ( "get_vtable_methods : not vtable safe" ) ;
672
+ debug ! ( "vtable_methods : not vtable safe" ) ;
673
673
return None ;
674
674
}
675
675
@@ -690,7 +690,7 @@ pub fn get_vtable_methods<'a, 'tcx>(
690
690
// do not want to try and trans it, in that case (see #23435).
691
691
let predicates = tcx. predicates_of ( def_id) . instantiate_own ( tcx, substs) ;
692
692
if !normalize_and_test_predicates ( tcx, predicates. predicates ) {
693
- debug ! ( "get_vtable_methods : predicates do not hold" ) ;
693
+ debug ! ( "vtable_methods : predicates do not hold" ) ;
694
694
return None ;
695
695
}
696
696
@@ -836,6 +836,7 @@ pub fn provide(providers: &mut ty::maps::Providers) {
836
836
specialization_graph_of : specialize:: specialization_graph_provider,
837
837
specializes : specialize:: specializes,
838
838
trans_fulfill_obligation : trans:: trans_fulfill_obligation,
839
+ vtable_methods,
839
840
..* providers
840
841
} ;
841
842
}
@@ -846,6 +847,7 @@ pub fn provide_extern(providers: &mut ty::maps::Providers) {
846
847
specialization_graph_of : specialize:: specialization_graph_provider,
847
848
specializes : specialize:: specializes,
848
849
trans_fulfill_obligation : trans:: trans_fulfill_obligation,
850
+ vtable_methods,
849
851
..* providers
850
852
} ;
851
853
}
0 commit comments