@@ -3,18 +3,23 @@ mod abi {
33 pub ( crate ) use crate :: Variants ;
44}
55
6+ #[ cfg( feature = "nightly" ) ]
67use rustc_macros:: HashStable_Generic ;
78
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 } ;
912
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 ) ]
1115pub enum RegKind {
1216 Integer ,
1317 Float ,
1418 Vector ,
1519}
1620
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 ) ]
1823pub struct Reg {
1924 pub kind : RegKind ,
2025 pub size : Size ,
@@ -108,15 +113,8 @@ impl HomogeneousAggregate {
108113 }
109114}
110115
116+ #[ cfg( feature = "nightly" ) ]
111117impl < ' 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-
120118 /// Returns `Homogeneous` if this layout is an aggregate containing fields of
121119 /// only a single type (e.g., `(u32, u32)`). Such aggregates are often
122120 /// special-cased in ABIs.
0 commit comments