Stabilize derive_default_enum

This commit is contained in:
Jacob Pratt 2022-02-28 15:33:50 -05:00
parent e745b4ddbd
commit abf2b4c04d
No known key found for this signature in database
GPG key ID: B80E19E4662B5AA4
15 changed files with 38 additions and 73 deletions

View file

@ -46,18 +46,7 @@ pub fn expand_deriving_default(
StaticStruct(_, fields) => {
default_struct_substructure(cx, trait_span, substr, fields)
}
StaticEnum(enum_def, _) => {
if !cx.sess.features_untracked().derive_default_enum {
rustc_session::parse::feature_err(
cx.parse_sess(),
sym::derive_default_enum,
span,
"deriving `Default` on enums is experimental",
)
.emit();
}
default_enum_substructure(cx, trait_span, enum_def)
}
StaticEnum(enum_def, _) => default_enum_substructure(cx, trait_span, enum_def),
_ => cx.span_bug(trait_span, "method in `derive(Default)`"),
}
})),