mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Revert write! and writeln! to late drop temporaries
This commit is contained in:
parent
cb0ed1bdae
commit
f1ca69d245
@ -496,10 +496,9 @@ macro_rules! r#try {
|
|||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(not(test), rustc_diagnostic_item = "write_macro")]
|
#[cfg_attr(not(test), rustc_diagnostic_item = "write_macro")]
|
||||||
macro_rules! write {
|
macro_rules! write {
|
||||||
($dst:expr, $($arg:tt)*) => {{
|
($dst:expr, $($arg:tt)*) => {
|
||||||
let result = $dst.write_fmt($crate::format_args!($($arg)*));
|
$dst.write_fmt($crate::format_args!($($arg)*))
|
||||||
result
|
};
|
||||||
}};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Write formatted data into a buffer, with a newline appended.
|
/// Write formatted data into a buffer, with a newline appended.
|
||||||
@ -554,10 +553,9 @@ macro_rules! writeln {
|
|||||||
($dst:expr $(,)?) => {
|
($dst:expr $(,)?) => {
|
||||||
$crate::write!($dst, "\n")
|
$crate::write!($dst, "\n")
|
||||||
};
|
};
|
||||||
($dst:expr, $($arg:tt)*) => {{
|
($dst:expr, $($arg:tt)*) => {
|
||||||
let result = $dst.write_fmt($crate::format_args_nl!($($arg)*));
|
$dst.write_fmt($crate::format_args_nl!($($arg)*))
|
||||||
result
|
};
|
||||||
}};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Indicates unreachable code.
|
/// Indicates unreachable code.
|
||||||
|
Loading…
Reference in New Issue
Block a user