@@ -12,7 +12,7 @@ use rustc_middle::query::Providers;
12
12
use rustc_middle:: ty:: layout:: { FnAbiOf , LayoutOf , TyAndLayout } ;
13
13
use rustc_middle:: ty:: GenericArgsRef ;
14
14
use rustc_middle:: ty:: {
15
- self , Const , FloatTy , GeneratorArgs , IntTy , ParamEnv , PolyFnSig , Ty , TyCtxt , TyKind ,
15
+ self , Const , CoroutineArgs , FloatTy , IntTy , ParamEnv , PolyFnSig , Ty , TyCtxt , TyKind ,
16
16
TypeAndMut , UintTy ,
17
17
} ;
18
18
use rustc_middle:: { bug, span_bug} ;
@@ -64,6 +64,9 @@ pub(crate) fn provide(providers: &mut Providers) {
64
64
) -> & ' tcx FnAbi < ' tcx , Ty < ' tcx > > {
65
65
let readjust_arg_abi = |arg : & ArgAbi < ' tcx , Ty < ' tcx > > | {
66
66
let mut arg = ArgAbi :: new ( & tcx, arg. layout , |_, _, _| ArgAttributes :: new ( ) ) ;
67
+ // FIXME: this is bad! https://github.com/rust-lang/rust/issues/115666
68
+ // <https://github.com/rust-lang/rust/commit/eaaa03faf77b157907894a4207d8378ecaec7b45>
69
+ arg. make_direct_deprecated ( ) ;
67
70
68
71
// Avoid pointlessly passing ZSTs, just like the official Rust ABI.
69
72
if arg. layout . is_zst ( ) {
@@ -96,7 +99,9 @@ pub(crate) fn provide(providers: &mut Providers) {
96
99
97
100
// FIXME(eddyb) remove this by deriving `Clone` for `LayoutS` upstream.
98
101
// FIXME(eddyb) the `S` suffix is a naming antipattern, rename upstream.
99
- fn clone_layout ( layout : & LayoutS ) -> LayoutS {
102
+ fn clone_layout < FieldIdx : Idx , VariantIdx : Idx > (
103
+ layout : & LayoutS < FieldIdx , VariantIdx > ,
104
+ ) -> LayoutS < FieldIdx , VariantIdx > {
100
105
let LayoutS {
101
106
ref fields,
102
107
ref variants,
@@ -744,7 +749,7 @@ fn trans_struct<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>) -
744
749
fn def_id_for_spirv_type_adt ( layout : TyAndLayout < ' _ > ) -> Option < DefId > {
745
750
match * layout. ty . kind ( ) {
746
751
TyKind :: Adt ( def, _) => Some ( def. did ( ) ) ,
747
- TyKind :: Foreign ( def_id) | TyKind :: Closure ( def_id, _) | TyKind :: Generator ( def_id, ..) => {
752
+ TyKind :: Foreign ( def_id) | TyKind :: Closure ( def_id, _) | TyKind :: Coroutine ( def_id, ..) => {
748
753
Some ( def_id)
749
754
}
750
755
_ => None ,
@@ -779,8 +784,8 @@ impl fmt::Display for TyLayoutNameKey<'_> {
779
784
write ! ( f, "::{}" , def. variants( ) [ index] . name) ?;
780
785
}
781
786
}
782
- if let ( TyKind :: Generator ( _, _, _) , Some ( index) ) = ( self . ty . kind ( ) , self . variant ) {
783
- write ! ( f, "::{}" , GeneratorArgs :: variant_name( index) ) ?;
787
+ if let ( TyKind :: Coroutine ( _, _, _) , Some ( index) ) = ( self . ty . kind ( ) , self . variant ) {
788
+ write ! ( f, "::{}" , CoroutineArgs :: variant_name( index) ) ?;
784
789
}
785
790
Ok ( ( ) )
786
791
}
0 commit comments