Skip to content

Commit 08e4ffd

Browse files
committed
Permit deriving default on enums with #[default]
1 parent 82c5814 commit 08e4ffd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/default.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ pub fn default<T: Default>() -> T {
161161
}
162162

163163
/// Derive macro generating an impl of the trait `Default`.
164-
#[rustc_builtin_macro]
164+
#[cfg_attr(not(bootstrap), rustc_builtin_macro(Default, attributes(default)))]
165+
#[cfg_attr(bootstrap, rustc_builtin_macro)]
165166
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
166167
#[allow_internal_unstable(core_intrinsics)]
167168
pub macro Default($item:item) {

0 commit comments

Comments
 (0)