Skip to content

Commit 5164db7

Browse files
committed
expand: Support helper attributes for built-in derive macros
1 parent c95979a commit 5164db7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

core/src/macros/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#[doc = include_str!("panic.md")]
22
#[macro_export]
3-
#[rustc_builtin_macro = "core_panic"]
3+
#[cfg_attr(bootstrap, rustc_builtin_macro = "core_panic")]
4+
#[cfg_attr(not(bootstrap), rustc_builtin_macro(core_panic))]
45
#[allow_internal_unstable(edition_panic)]
56
#[stable(feature = "core", since = "1.6.0")]
67
#[rustc_diagnostic_item = "core_panic_macro"]

std/src/macros.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
77
#[doc = include_str!("../../core/src/macros/panic.md")]
88
#[macro_export]
9-
#[rustc_builtin_macro = "std_panic"]
9+
#[cfg_attr(bootstrap, rustc_builtin_macro = "std_panic")]
10+
#[cfg_attr(not(bootstrap), rustc_builtin_macro(std_panic))]
1011
#[stable(feature = "rust1", since = "1.0.0")]
1112
#[allow_internal_unstable(edition_panic)]
1213
#[cfg_attr(not(test), rustc_diagnostic_item = "std_panic_macro")]

0 commit comments

Comments
 (0)