@@ -4,7 +4,7 @@ use rustc_ast::Mutability;
44use rustc_macros:: HashStable ;
55
66use crate :: mir:: interpret:: { AllocId , Allocation , CTFE_ALLOC_SALT , Pointer , Scalar , alloc_range} ;
7- use crate :: ty:: { self , Instance , PolyTraitRef , Ty , TyCtxt } ;
7+ use crate :: ty:: { self , Instance , TraitRef , Ty , TyCtxt } ;
88
99#[ derive( Clone , Copy , PartialEq , HashStable ) ]
1010pub enum VtblEntry < ' tcx > {
@@ -19,7 +19,7 @@ pub enum VtblEntry<'tcx> {
1919 /// dispatchable associated function
2020 Method ( Instance < ' tcx > ) ,
2121 /// pointer to a separate supertrait vtable, can be used by trait upcasting coercion
22- TraitVPtr ( PolyTraitRef < ' tcx > ) ,
22+ TraitVPtr ( TraitRef < ' tcx > ) ,
2323}
2424
2525impl < ' tcx > fmt:: Debug for VtblEntry < ' tcx > {
@@ -56,15 +56,15 @@ pub const COMMON_VTABLE_ENTRIES_ALIGN: usize = 2;
5656// function is an accurate approximation. We verify this when actually computing the vtable below.
5757pub ( crate ) fn vtable_min_entries < ' tcx > (
5858 tcx : TyCtxt < ' tcx > ,
59- trait_ref : Option < ty:: PolyExistentialTraitRef < ' tcx > > ,
59+ trait_ref : Option < ty:: ExistentialTraitRef < ' tcx > > ,
6060) -> usize {
6161 let mut count = TyCtxt :: COMMON_VTABLE_ENTRIES . len ( ) ;
6262 let Some ( trait_ref) = trait_ref else {
6363 return count;
6464 } ;
6565
6666 // This includes self in supertraits.
67- for def_id in tcx. supertrait_def_ids ( trait_ref. def_id ( ) ) {
67+ for def_id in tcx. supertrait_def_ids ( trait_ref. def_id ) {
6868 count += tcx. own_existential_vtable_entries ( def_id) . len ( ) ;
6969 }
7070
@@ -80,7 +80,7 @@ pub(crate) fn vtable_min_entries<'tcx>(
8080/// initial contents.)
8181pub ( super ) fn vtable_allocation_provider < ' tcx > (
8282 tcx : TyCtxt < ' tcx > ,
83- key : ( Ty < ' tcx > , Option < ty:: PolyExistentialTraitRef < ' tcx > > ) ,
83+ key : ( Ty < ' tcx > , Option < ty:: ExistentialTraitRef < ' tcx > > ) ,
8484) -> AllocId {
8585 let ( ty, poly_trait_ref) = key;
8686
@@ -115,7 +115,7 @@ pub(super) fn vtable_allocation_provider<'tcx>(
115115
116116 for ( idx, entry) in vtable_entries. iter ( ) . enumerate ( ) {
117117 let idx: u64 = u64:: try_from ( idx) . unwrap ( ) ;
118- let scalar = match entry {
118+ let scalar = match * entry {
119119 VtblEntry :: MetadataDropInPlace => {
120120 if ty. needs_drop ( tcx, ty:: TypingEnv :: fully_monomorphized ( ) ) {
121121 let instance = ty:: Instance :: resolve_drop_in_place ( tcx, ty) ;
@@ -131,13 +131,12 @@ pub(super) fn vtable_allocation_provider<'tcx>(
131131 VtblEntry :: Vacant => continue ,
132132 VtblEntry :: Method ( instance) => {
133133 // Prepare the fn ptr we write into the vtable.
134- let fn_alloc_id = tcx. reserve_and_set_fn_alloc ( * instance, CTFE_ALLOC_SALT ) ;
134+ let fn_alloc_id = tcx. reserve_and_set_fn_alloc ( instance, CTFE_ALLOC_SALT ) ;
135135 let fn_ptr = Pointer :: from ( fn_alloc_id) ;
136136 Scalar :: from_pointer ( fn_ptr, & tcx)
137137 }
138138 VtblEntry :: TraitVPtr ( trait_ref) => {
139- let super_trait_ref = trait_ref
140- . map_bound ( |trait_ref| ty:: ExistentialTraitRef :: erase_self_ty ( tcx, trait_ref) ) ;
139+ let super_trait_ref = ty:: ExistentialTraitRef :: erase_self_ty ( tcx, trait_ref) ;
141140 let supertrait_alloc_id = tcx. vtable_allocation ( ( ty, Some ( super_trait_ref) ) ) ;
142141 let vptr = Pointer :: from ( supertrait_alloc_id) ;
143142 Scalar :: from_pointer ( vptr, & tcx)
0 commit comments