Make const_fmt_args!() work during bootstrap.
This commit is contained in:
parent
b48274fd98
commit
38bf5b0412
1 changed files with 11 additions and 0 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue