Skip to content

Commit 38bf5b0

Browse files
committed
Make const_fmt_args!() work during bootstrap.
1 parent b48274f commit 38bf5b0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

library/core/src/macros/mod.rs

+11
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@ pub(crate) mod builtin {
838838
}
839839

840840
/// Same as `format_args`, but can be used in some const contexts.
841+
#[cfg(not(bootstrap))]
841842
#[unstable(feature = "const_format_args", issue = "none")]
842843
#[allow_internal_unstable(fmt_internals, const_fmt_arguments_new)]
843844
#[rustc_builtin_macro]
@@ -847,6 +848,16 @@ pub(crate) mod builtin {
847848
($fmt:expr, $($args:tt)*) => {{ /* compiler built-in */ }};
848849
}
849850

851+
/// Same as `format_args`, but can be used in some const contexts.
852+
#[cfg(bootstrap)]
853+
#[unstable(feature = "const_format_args", issue = "none")]
854+
#[macro_export]
855+
macro_rules! const_format_args {
856+
($($t:tt)*) => {
857+
$crate::format_args!($($t)*)
858+
}
859+
}
860+
850861
/// Same as `format_args`, but adds a newline in the end.
851862
#[unstable(
852863
feature = "format_args_nl",

0 commit comments

Comments
 (0)