mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 04:08:40 +00:00
Streamline the format
macro.
Removing the unnecessary local variable speeds up compilation a little.
This commit is contained in:
parent
cb31a009e3
commit
bc8df506f6
@ -105,8 +105,7 @@ macro_rules! vec {
|
|||||||
macro_rules! format {
|
macro_rules! format {
|
||||||
($($arg:tt)*) => {
|
($($arg:tt)*) => {
|
||||||
$crate::__export::must_use({
|
$crate::__export::must_use({
|
||||||
let res = $crate::fmt::format($crate::__export::format_args!($($arg)*));
|
$crate::fmt::format($crate::__export::format_args!($($arg)*))
|
||||||
res
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,14 +31,12 @@ fn bar() ({
|
|||||||
|
|
||||||
((::alloc::__export::must_use as
|
((::alloc::__export::must_use as
|
||||||
fn(String) -> String {must_use::<String>})(({
|
fn(String) -> String {must_use::<String>})(({
|
||||||
let res =
|
((::alloc::fmt::format as
|
||||||
((::alloc::fmt::format as
|
for<'a> fn(Arguments<'a>) -> String {format})(((format_arguments::new_const
|
||||||
for<'a> fn(Arguments<'a>) -> String {format})(((format_arguments::new_const
|
as
|
||||||
as
|
fn(&[&'static str; 1]) -> Arguments<'_> {Arguments::<'_>::new_const::<1>})((&([("test"
|
||||||
fn(&[&'static str; 1]) -> Arguments<'_> {Arguments::<'_>::new_const::<1>})((&([("test"
|
as &str)] as [&str; 1]) as &[&str; 1])) as Arguments<'_>))
|
||||||
as &str)] as [&str; 1]) as &[&str; 1])) as Arguments<'_>))
|
as String)
|
||||||
as String);
|
|
||||||
(res as String)
|
|
||||||
} as String)) as String);
|
} as String)) as String);
|
||||||
} as ())
|
} as ())
|
||||||
type Foo = [i32; (3 as usize)];
|
type Foo = [i32; (3 as usize)];
|
||||||
|
Loading…
Reference in New Issue
Block a user