Improve codegen for single argument format_args! #75301
Labels
A-fmt
Area: `std::fmt`
C-bug
Category: This is a bug.
I-heavy
Issue: Problems and improvements with respect to binary size of generated code.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I was using
write!
in a lot of places, some I just dowrite!(writer, " ")
but I noticed that the generated assembly is not as good aswriter.write_all(b" ")
. Since we have minimalconst fn
now, I wonder if we could improve the generated assembly when a single character or a single argument is passed in.https://rust.godbolt.org/z/zzEMjd
I also
write!()
could accept a single byte or character. Example,write!(buf, ' ')
.If anyone can mentor, maybe I can take on this part (hopefully without compiling rust).
Meta
rustc --version --verbose
:CC @lzutao
The text was updated successfully, but these errors were encountered: