Skip to content

Revert write! and writeln! to late drop temporaries#99689

Merged
bors merged 4 commits intorust-lang:masterfrom
dtolnay:write
Jul 28, 2022
Merged

Revert write! and writeln! to late drop temporaries#99689
bors merged 4 commits intorust-lang:masterfrom
dtolnay:write

Conversation

@dtolnay
Copy link
Member

@dtolnay dtolnay commented Jul 24, 2022

Closes (on master, but not on beta) #99684 by reverting the write! and writeln! parts of #96455.

argument position before
#94868
after
#94868
after
#96455
after
this PR
desired
(unimplementable)
write!($tmp, "…", …) ⸺late ⸺late early⸺ ⸺late ⸺late
write!(…, "…", $tmp) ⸺late ⸺late early⸺ ⸺late early⸺
writeln!($tmp, "…", …) ⸺late ⸺late early⸺ ⸺late ⸺late
writeln!(…, "…", $tmp) ⸺late ⸺late early⸺ ⸺late early⸺
print!("…", $tmp) ⸺late ⸺late early⸺ early⸺ early⸺
println!("…", $tmp) early⸺ ⸺late early⸺ early⸺ early⸺
eprint!("…", $tmp) ⸺late ⸺late early⸺ early⸺ early⸺
eprintln!("…", $tmp) early⸺ ⸺late early⸺ early⸺ early⸺
panic!("…", $tmp) early⸺ early⸺ early⸺ early⸺ early⸺

"Late drop" refers to dropping temporaries at the nearest semicolon outside of the macro invocation.

"Early drop" refers to dropping temporaries inside of the macro invocation.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-fmt Area: `core::fmt` beta-accepted Accepted for backporting to the compiler in the beta channel. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants