@@ -1756,7 +1756,7 @@ bitflags! {
1756
1756
const IS_ENUM = 1 << 0 ;
1757
1757
const IS_UNION = 1 << 1 ;
1758
1758
const IS_STRUCT = 1 << 2 ;
1759
- const IS_TUPLE_STRUCT = 1 << 3 ;
1759
+ const HAS_CTOR = 1 << 3 ;
1760
1760
const IS_PHANTOM_DATA = 1 << 4 ;
1761
1761
const IS_FUNDAMENTAL = 1 << 5 ;
1762
1762
const IS_BOX = 1 << 6 ;
@@ -2096,7 +2096,7 @@ impl<'a, 'gcx, 'tcx> AdtDef {
2096
2096
let variant_def = & variants[ VariantIdx :: new ( 0 ) ] ;
2097
2097
let def_key = tcx. def_key ( variant_def. did ) ;
2098
2098
match def_key. disambiguated_data . data {
2099
- DefPathData :: StructCtor => flags |= AdtFlags :: IS_TUPLE_STRUCT ,
2099
+ DefPathData :: StructCtor => flags |= AdtFlags :: HAS_CTOR ,
2100
2100
_ => ( ) ,
2101
2101
}
2102
2102
}
@@ -2131,12 +2131,6 @@ impl<'a, 'gcx, 'tcx> AdtDef {
2131
2131
self . flags . contains ( AdtFlags :: IS_STRUCT )
2132
2132
}
2133
2133
2134
- /// If this function returns `true`, it implies that `is_struct` must return `true`.
2135
- #[ inline]
2136
- pub fn is_tuple_struct ( & self ) -> bool {
2137
- self . flags . contains ( AdtFlags :: IS_TUPLE_STRUCT )
2138
- }
2139
-
2140
2134
#[ inline]
2141
2135
pub fn is_union ( & self ) -> bool {
2142
2136
self . flags . contains ( AdtFlags :: IS_UNION )
@@ -2181,6 +2175,12 @@ impl<'a, 'gcx, 'tcx> AdtDef {
2181
2175
}
2182
2176
}
2183
2177
2178
+ /// If this function returns `true`, it implies that `is_struct` must return `true`.
2179
+ #[ inline]
2180
+ pub fn has_ctor ( & self ) -> bool {
2181
+ self . flags . contains ( AdtFlags :: HAS_CTOR )
2182
+ }
2183
+
2184
2184
/// Returns whether this type is `#[fundamental]` for the purposes
2185
2185
/// of coherence checking.
2186
2186
#[ inline]
0 commit comments