@@ -3,18 +3,23 @@ mod abi {
3
3
pub ( crate ) use crate :: Variants ;
4
4
}
5
5
6
+ #[ cfg( feature = "nightly" ) ]
6
7
use rustc_macros:: HashStable_Generic ;
7
8
8
- use crate :: { Abi , Align , FieldsShape , HasDataLayout , Size , TyAbiInterface , TyAndLayout } ;
9
+ #[ cfg( feature = "nightly" ) ]
10
+ use crate :: { Abi , FieldsShape , TyAbiInterface , TyAndLayout } ;
11
+ use crate :: { Align , HasDataLayout , Size } ;
9
12
10
- #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , HashStable_Generic ) ]
13
+ #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
14
+ #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug ) ]
11
15
pub enum RegKind {
12
16
Integer ,
13
17
Float ,
14
18
Vector ,
15
19
}
16
20
17
- #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , HashStable_Generic ) ]
21
+ #[ cfg_attr( feature = "nightly" , derive( HashStable_Generic ) ) ]
22
+ #[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug ) ]
18
23
pub struct Reg {
19
24
pub kind : RegKind ,
20
25
pub size : Size ,
@@ -108,15 +113,8 @@ impl HomogeneousAggregate {
108
113
}
109
114
}
110
115
116
+ #[ cfg( feature = "nightly" ) ]
111
117
impl < ' a , Ty > TyAndLayout < ' a , Ty > {
112
- /// Returns `true` if this is an aggregate type (including a ScalarPair!)
113
- pub fn is_aggregate ( & self ) -> bool {
114
- match self . abi {
115
- Abi :: Uninhabited | Abi :: Scalar ( _) | Abi :: Vector { .. } => false ,
116
- Abi :: ScalarPair ( ..) | Abi :: Aggregate { .. } => true ,
117
- }
118
- }
119
-
120
118
/// Returns `Homogeneous` if this layout is an aggregate containing fields of
121
119
/// only a single type (e.g., `(u32, u32)`). Such aggregates are often
122
120
/// special-cased in ABIs.
0 commit comments