Make const_fmt_args!() work during bootstrap.

This commit is contained in:
Mara Bos 2021-07-09 17:39:37 +02:00
parent b48274fd98
commit 38bf5b0412

View file

@ -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",