@@ -47,6 +47,7 @@ use rustc_data_structures::fingerprint::Fingerprint;
4747use rustc_data_structures:: sorted_map:: SortedMap ;
4848use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
4949use rustc_data_structures:: sync:: Lrc ;
50+ use rustc_data_structures:: tagged_ptr:: CovariantCopyTaggedPtr ;
5051use rustc_errors:: { DiagArgFromDisplay , DiagCtxtHandle , StashKey } ;
5152use rustc_hir:: def:: { DefKind , LifetimeRes , Namespace , PartialRes , PerNS , Res } ;
5253use rustc_hir:: def_id:: { CRATE_DEF_ID , LOCAL_CRATE , LocalDefId } ;
@@ -1157,7 +1158,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11571158 let lifetime_bound = this. elided_dyn_bound ( t. span ) ;
11581159 ( bounds, lifetime_bound)
11591160 } ) ;
1160- let kind = hir:: TyKind :: TraitObject ( bounds, lifetime_bound, TraitObjectSyntax :: None ) ;
1161+ let kind = hir:: TyKind :: TraitObject (
1162+ bounds,
1163+ CovariantCopyTaggedPtr :: new ( lifetime_bound, TraitObjectSyntax :: None ) ,
1164+ ) ;
11611165 return hir:: Ty { kind, span : self . lower_span ( t. span ) , hir_id : self . next_id ( ) } ;
11621166 }
11631167
@@ -1308,7 +1312,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
13081312 lifetime_bound. unwrap_or_else ( || this. elided_dyn_bound ( t. span ) ) ;
13091313 ( bounds, lifetime_bound)
13101314 } ) ;
1311- hir:: TyKind :: TraitObject ( bounds, lifetime_bound, * kind)
1315+ hir:: TyKind :: TraitObject ( bounds, CovariantCopyTaggedPtr :: new ( lifetime_bound, * kind) )
13121316 }
13131317 TyKind :: ImplTrait ( def_node_id, bounds) => {
13141318 let span = t. span ;
@@ -2364,8 +2368,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
23642368 hir_id = self . next_id ( ) ;
23652369 hir:: TyKind :: TraitObject (
23662370 arena_vec ! [ self ; principal] ,
2367- self . elided_dyn_bound ( span) ,
2368- TraitObjectSyntax :: None ,
2371+ CovariantCopyTaggedPtr :: new (
2372+ self . elided_dyn_bound ( span) ,
2373+ TraitObjectSyntax :: None ,
2374+ ) ,
23692375 )
23702376 }
23712377 _ => hir:: TyKind :: Path ( hir:: QPath :: Resolved ( None , path) ) ,
0 commit comments