diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index dbaec2a91d20..7568565cf59d 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -838,6 +838,7 @@ pub(crate) mod builtin { } /// Same as `format_args`, but can be used in some const contexts. + #[cfg(not(bootstrap))] #[unstable(feature = "const_format_args", issue = "none")] #[allow_internal_unstable(fmt_internals, const_fmt_arguments_new)] #[rustc_builtin_macro] @@ -847,6 +848,16 @@ pub(crate) mod builtin { ($fmt:expr, $($args:tt)*) => {{ /* compiler built-in */ }}; } + /// Same as `format_args`, but can be used in some const contexts. + #[cfg(bootstrap)] + #[unstable(feature = "const_format_args", issue = "none")] + #[macro_export] + macro_rules! const_format_args { + ($($t:tt)*) => { + $crate::format_args!($($t)*) + } + } + /// Same as `format_args`, but adds a newline in the end. #[unstable( feature = "format_args_nl",