1
1
use rustc_middle:: bug;
2
- use rustc_middle:: ty:: layout:: { FnAbiOf , HasTyCtxt , LayoutOf , TyAndLayout } ;
2
+ use rustc_middle:: ty:: layout:: { HasTyCtxt , TyAndLayout } ;
3
3
use rustc_middle:: ty:: { self , Ty } ;
4
4
use rustc_target:: abi:: call:: { ArgAbi , CastTarget , FnAbi , Reg } ;
5
5
use rustc_target:: abi:: { AddressSpace , Float , Integer } ;
@@ -9,7 +9,7 @@ use super::BackendTypes;
9
9
use crate :: common:: TypeKind ;
10
10
use crate :: mir:: place:: PlaceRef ;
11
11
12
- pub trait BaseTypeMethods < ' tcx > : BackendTypes + HasTyCtxt < ' tcx > {
12
+ pub trait BaseTypeMethods < ' tcx > : BackendTypes {
13
13
fn type_i8 ( & self ) -> Self :: Type ;
14
14
fn type_i16 ( & self ) -> Self :: Type ;
15
15
fn type_i32 ( & self ) -> Self :: Type ;
@@ -40,7 +40,9 @@ pub trait BaseTypeMethods<'tcx>: BackendTypes + HasTyCtxt<'tcx> {
40
40
fn val_ty ( & self , v : Self :: Value ) -> Self :: Type ;
41
41
}
42
42
43
- pub trait DerivedTypeMethods < ' tcx > : BaseTypeMethods < ' tcx > + MiscMethods < ' tcx > {
43
+ pub trait DerivedTypeMethods < ' tcx > :
44
+ BaseTypeMethods < ' tcx > + MiscMethods < ' tcx > + HasTyCtxt < ' tcx >
45
+ {
44
46
fn type_int ( & self ) -> Self :: Type {
45
47
match & self . sess ( ) . target . c_int_width [ ..] {
46
48
"16" => self . type_i16 ( ) ,
@@ -98,13 +100,12 @@ pub trait DerivedTypeMethods<'tcx>: BaseTypeMethods<'tcx> + MiscMethods<'tcx> {
98
100
}
99
101
}
100
102
101
- impl < ' tcx , T > DerivedTypeMethods < ' tcx > for T where Self : BaseTypeMethods < ' tcx > + MiscMethods < ' tcx > { }
102
-
103
- pub trait LayoutTypeMethods < ' tcx > :
104
- BackendTypes
105
- + LayoutOf < ' tcx , LayoutOfResult = TyAndLayout < ' tcx > >
106
- + FnAbiOf < ' tcx , FnAbiOfResult = & ' tcx FnAbi < ' tcx , Ty < ' tcx > > >
103
+ impl < ' tcx , T > DerivedTypeMethods < ' tcx > for T where
104
+ Self : BaseTypeMethods < ' tcx > + MiscMethods < ' tcx > + HasTyCtxt < ' tcx >
107
105
{
106
+ }
107
+
108
+ pub trait LayoutTypeMethods < ' tcx > : BackendTypes {
108
109
/// The backend type used for a rust type when it's in memory,
109
110
/// such as when it's stack-allocated or when it's being loaded or stored.
110
111
fn backend_type ( & self , layout : TyAndLayout < ' tcx > ) -> Self :: Type ;
0 commit comments