Skip to content

Commit

Permalink
Rollup merge of rust-lang#64060 - petrochenkov:unstdhyg, r=tmandry
Browse files Browse the repository at this point in the history
Improve hygiene of `alloc::format!`

`format` now uses `format_args` though a `__export` module, as described in rust-lang#63687 (comment).

Fixes rust-lang#63687
  • Loading branch information
Centril authored Sep 11, 2019
2 parents 34e82a7 + d42e603 commit e757d33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion src/liballoc/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)*)))
}

0 comments on commit e757d33

Please sign in to comment.