File tree 1 file changed +3
-1
lines changed
compiler/rustc_middle/src/ty
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -2735,6 +2735,8 @@ impl<'tcx> Ty<'tcx> {
2735
2735
| ty:: Error ( _)
2736
2736
// Extern types have metadata = ().
2737
2737
| ty:: Foreign ( ..)
2738
+ // `dyn*` has no metadata
2739
+ | ty:: Dynamic ( _, _, DynKind :: DynStar )
2738
2740
// If returned by `struct_tail_without_normalization` this is a unit struct
2739
2741
// without any fields, or not a struct, and therefore is Sized.
2740
2742
| ty:: Adt ( ..)
@@ -2743,7 +2745,7 @@ impl<'tcx> Ty<'tcx> {
2743
2745
| ty:: Tuple ( ..) => ( tcx. types . unit , false ) ,
2744
2746
2745
2747
ty:: Str | ty:: Slice ( _) => ( tcx. types . usize , false ) ,
2746
- ty:: Dynamic ( .. ) => {
2748
+ ty:: Dynamic ( _ , _ , DynKind :: Dyn ) => {
2747
2749
let dyn_metadata = tcx. require_lang_item ( LangItem :: DynMetadata , None ) ;
2748
2750
( tcx. type_of ( dyn_metadata) . instantiate ( tcx, & [ tail. into ( ) ] ) , false )
2749
2751
} ,
You can’t perform that action at this time.
0 commit comments