about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-07-09 17:39:37 +0200
committerMara Bos <m-ou.se@m-ou.se>2021-07-28 16:12:31 +0200
commit38bf5b0412fc38313d8db931febb306093c1bcae (patch)
treeb55a299ac8d10e5efa3a6c55f9a972b3e8371147
parentb48274fd98b74c1fb28842d899aa0ee377d9f923 (diff)
downloadrust-38bf5b0412fc38313d8db931febb306093c1bcae.tar.gz
rust-38bf5b0412fc38313d8db931febb306093c1bcae.zip
Make const_fmt_args!() work during bootstrap.
-rw-r--r--library/core/src/macros/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs
index dbaec2a91d2..7568565cf59 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",