1- //! Conversion of internal Rust compiler `rustc_target::abi ` and `rustc_abi` items to stable ones.
1+ //! Conversion of internal Rust compiler `rustc_target` and `rustc_abi` items to stable ones.
22
33#![ allow( rustc:: usage_of_qualified_ty) ]
44
55use rustc_middle:: ty;
6- use rustc_target:: abi :: call :: Conv ;
6+ use rustc_target:: callconv :: { self , Conv } ;
77use stable_mir:: abi:: {
88 AddressSpace , ArgAbi , CallConvention , FieldsShape , FloatLength , FnAbi , IntegerLength , Layout ,
99 LayoutShape , PassMode , Primitive , Scalar , TagEncoding , TyAndLayout , ValueAbi , VariantsShape ,
@@ -15,7 +15,7 @@ use stable_mir::ty::{Align, IndexedVal, VariantIdx};
1515
1616use crate :: rustc_smir:: { Stable , Tables } ;
1717
18- impl < ' tcx > Stable < ' tcx > for rustc_target :: abi :: VariantIdx {
18+ impl < ' tcx > Stable < ' tcx > for rustc_abi :: VariantIdx {
1919 type T = VariantIdx ;
2020 fn stable ( & self , _: & mut Tables < ' _ > ) -> Self :: T {
2121 VariantIdx :: to_val ( self . as_usize ( ) )
@@ -33,25 +33,23 @@ impl<'tcx> Stable<'tcx> for rustc_abi::Endian {
3333 }
3434}
3535
36- impl < ' tcx > Stable < ' tcx > for rustc_target :: abi :: TyAndLayout < ' tcx , ty:: Ty < ' tcx > > {
36+ impl < ' tcx > Stable < ' tcx > for rustc_abi :: TyAndLayout < ' tcx , ty:: Ty < ' tcx > > {
3737 type T = TyAndLayout ;
3838
3939 fn stable ( & self , tables : & mut Tables < ' _ > ) -> Self :: T {
4040 TyAndLayout { ty : self . ty . stable ( tables) , layout : self . layout . stable ( tables) }
4141 }
4242}
4343
44- impl < ' tcx > Stable < ' tcx > for rustc_target :: abi :: Layout < ' tcx > {
44+ impl < ' tcx > Stable < ' tcx > for rustc_abi :: Layout < ' tcx > {
4545 type T = Layout ;
4646
4747 fn stable ( & self , tables : & mut Tables < ' _ > ) -> Self :: T {
4848 tables. layout_id ( tables. tcx . lift ( * self ) . unwrap ( ) )
4949 }
5050}
5151
52- impl < ' tcx > Stable < ' tcx >
53- for rustc_abi:: LayoutData < rustc_target:: abi:: FieldIdx , rustc_target:: abi:: VariantIdx >
54- {
52+ impl < ' tcx > Stable < ' tcx > for rustc_abi:: LayoutData < rustc_abi:: FieldIdx , rustc_abi:: VariantIdx > {
5553 type T = LayoutShape ;
5654
5755 fn stable ( & self , tables : & mut Tables < ' _ > ) -> Self :: T {
@@ -65,7 +63,7 @@ impl<'tcx> Stable<'tcx>
6563 }
6664}
6765
68- impl < ' tcx > Stable < ' tcx > for rustc_target :: abi :: call :: FnAbi < ' tcx , ty:: Ty < ' tcx > > {
66+ impl < ' tcx > Stable < ' tcx > for callconv :: FnAbi < ' tcx , ty:: Ty < ' tcx > > {
6967 type T = FnAbi ;
7068
7169 fn stable ( & self , tables : & mut Tables < ' _ > ) -> Self :: T {
@@ -81,7 +79,7 @@ impl<'tcx> Stable<'tcx> for rustc_target::abi::call::FnAbi<'tcx, ty::Ty<'tcx>> {
8179 }
8280}
8381
84- impl < ' tcx > Stable < ' tcx > for rustc_target :: abi :: call :: ArgAbi < ' tcx , ty:: Ty < ' tcx > > {
82+ impl < ' tcx > Stable < ' tcx > for callconv :: ArgAbi < ' tcx , ty:: Ty < ' tcx > > {
8583 type T = ArgAbi ;
8684
8785 fn stable ( & self , tables : & mut Tables < ' _ > ) -> Self :: T {
@@ -93,7 +91,7 @@ impl<'tcx> Stable<'tcx> for rustc_target::abi::call::ArgAbi<'tcx, ty::Ty<'tcx>>
9391 }
9492}
9593
96- impl < ' tcx > Stable < ' tcx > for rustc_target :: abi :: call :: Conv {
94+ impl < ' tcx > Stable < ' tcx > for callconv :: Conv {
9795 type T = CallConvention ;
9896
9997 fn stable ( & self , _tables : & mut Tables < ' _ > ) -> Self :: T {
@@ -122,31 +120,29 @@ impl<'tcx> Stable<'tcx> for rustc_target::abi::call::Conv {
122120 }
123121}
124122
125- impl < ' tcx > Stable < ' tcx > for rustc_target :: abi :: call :: PassMode {
123+ impl < ' tcx > Stable < ' tcx > for callconv :: PassMode {
126124 type T = PassMode ;
127125
128126 fn stable ( & self , _tables : & mut Tables < ' _ > ) -> Self :: T {
129127 match self {
130- rustc_target :: abi :: call :: PassMode :: Ignore => PassMode :: Ignore ,
131- rustc_target :: abi :: call :: PassMode :: Direct ( attr) => PassMode :: Direct ( opaque ( attr) ) ,
132- rustc_target :: abi :: call :: PassMode :: Pair ( first, second) => {
128+ callconv :: PassMode :: Ignore => PassMode :: Ignore ,
129+ callconv :: PassMode :: Direct ( attr) => PassMode :: Direct ( opaque ( attr) ) ,
130+ callconv :: PassMode :: Pair ( first, second) => {
133131 PassMode :: Pair ( opaque ( first) , opaque ( second) )
134132 }
135- rustc_target :: abi :: call :: PassMode :: Cast { pad_i32, cast } => {
133+ callconv :: PassMode :: Cast { pad_i32, cast } => {
136134 PassMode :: Cast { pad_i32 : * pad_i32, cast : opaque ( cast) }
137135 }
138- rustc_target:: abi:: call:: PassMode :: Indirect { attrs, meta_attrs, on_stack } => {
139- PassMode :: Indirect {
140- attrs : opaque ( attrs) ,
141- meta_attrs : opaque ( meta_attrs) ,
142- on_stack : * on_stack,
143- }
144- }
136+ callconv:: PassMode :: Indirect { attrs, meta_attrs, on_stack } => PassMode :: Indirect {
137+ attrs : opaque ( attrs) ,
138+ meta_attrs : opaque ( meta_attrs) ,
139+ on_stack : * on_stack,
140+ } ,
145141 }
146142 }
147143}
148144
149- impl < ' tcx > Stable < ' tcx > for rustc_abi:: FieldsShape < rustc_target :: abi :: FieldIdx > {
145+ impl < ' tcx > Stable < ' tcx > for rustc_abi:: FieldsShape < rustc_abi :: FieldIdx > {
150146 type T = FieldsShape ;
151147
152148 fn stable ( & self , tables : & mut Tables < ' _ > ) -> Self :: T {
@@ -163,9 +159,7 @@ impl<'tcx> Stable<'tcx> for rustc_abi::FieldsShape<rustc_target::abi::FieldIdx>
163159 }
164160}
165161
166- impl < ' tcx > Stable < ' tcx >
167- for rustc_abi:: Variants < rustc_target:: abi:: FieldIdx , rustc_target:: abi:: VariantIdx >
168- {
162+ impl < ' tcx > Stable < ' tcx > for rustc_abi:: Variants < rustc_abi:: FieldIdx , rustc_abi:: VariantIdx > {
169163 type T = VariantsShape ;
170164
171165 fn stable ( & self , tables : & mut Tables < ' _ > ) -> Self :: T {
@@ -185,7 +179,7 @@ impl<'tcx> Stable<'tcx>
185179 }
186180}
187181
188- impl < ' tcx > Stable < ' tcx > for rustc_abi:: TagEncoding < rustc_target :: abi :: VariantIdx > {
182+ impl < ' tcx > Stable < ' tcx > for rustc_abi:: TagEncoding < rustc_abi :: VariantIdx > {
189183 type T = TagEncoding ;
190184
191185 fn stable ( & self , tables : & mut Tables < ' _ > ) -> Self :: T {
0 commit comments