From d42e60331fb08efce78e7fc9739bf42620e51f8f Mon Sep 17 00:00:00 2001
From: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Date: Sun, 1 Sep 2019 14:10:50 +0300
Subject: [PATCH] Improve hygiene of `alloc::format!`

---
 src/liballoc/lib.rs    | 6 ++++++
 src/liballoc/macros.rs | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 4a48945adc37a..370e5cf4b303f 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -171,3 +171,9 @@ pub mod vec;
 mod std {
     pub use core::ops; // RangeFull
 }
+
+#[doc(hidden)]
+#[unstable(feature = "liballoc_internals", issue = "0", reason = "implementation detail")]
+pub mod __export {
+    pub use core::format_args;
+}
diff --git a/src/liballoc/macros.rs b/src/liballoc/macros.rs
index 0b5e186d4c77b..2f2cdc39c633d 100644
--- a/src/liballoc/macros.rs
+++ b/src/liballoc/macros.rs
@@ -98,5 +98,5 @@ macro_rules! vec {
 #[macro_export]
 #[stable(feature = "rust1", since = "1.0.0")]
 macro_rules! format {
-    ($($arg:tt)*) => ($crate::fmt::format(::core::format_args!($($arg)*)))
+    ($($arg:tt)*) => ($crate::fmt::format($crate::__export::format_args!($($arg)*)))
 }