@@ -1756,7 +1756,7 @@ bitflags! {
17561756 const IS_ENUM = 1 << 0 ;
17571757 const IS_UNION = 1 << 1 ;
17581758 const IS_STRUCT = 1 << 2 ;
1759- const IS_TUPLE_STRUCT = 1 << 3 ;
1759+ const HAS_CTOR = 1 << 3 ;
17601760 const IS_PHANTOM_DATA = 1 << 4 ;
17611761 const IS_FUNDAMENTAL = 1 << 5 ;
17621762 const IS_BOX = 1 << 6 ;
@@ -2096,7 +2096,7 @@ impl<'a, 'gcx, 'tcx> AdtDef {
20962096 let variant_def = & variants[ VariantIdx :: new ( 0 ) ] ;
20972097 let def_key = tcx. def_key ( variant_def. did ) ;
20982098 match def_key. disambiguated_data . data {
2099- DefPathData :: StructCtor => flags |= AdtFlags :: IS_TUPLE_STRUCT ,
2099+ DefPathData :: StructCtor => flags |= AdtFlags :: HAS_CTOR ,
21002100 _ => ( ) ,
21012101 }
21022102 }
@@ -2131,12 +2131,6 @@ impl<'a, 'gcx, 'tcx> AdtDef {
21312131 self . flags . contains ( AdtFlags :: IS_STRUCT )
21322132 }
21332133
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-
21402134 #[ inline]
21412135 pub fn is_union ( & self ) -> bool {
21422136 self . flags . contains ( AdtFlags :: IS_UNION )
@@ -2181,6 +2175,12 @@ impl<'a, 'gcx, 'tcx> AdtDef {
21812175 }
21822176 }
21832177
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+
21842184 /// Returns whether this type is `#[fundamental]` for the purposes
21852185 /// of coherence checking.
21862186 #[ inline]
0 commit comments