impl fmt::Display for u32
compiles to large binary
#118940
Labels
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
I-heavy
Issue: Problems and improvements with respect to binary size of generated code.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
My target is
wasm32-unknown-unknown
but I think it can be applied to any embedded systems. I just want to define panic handler, but formattingcore::panic::Location
costs amlost 3 KiB in binary. This is because inefficientimpl Display for u32
. Also see: https://github.com/dtolnay/itoaThis is mostly because this line:
rust/library/core/src/fmt/num.rs
Line 277 in 1aa6aef
Could we have something like specialization for more simpler
impl Display for $num
?The text was updated successfully, but these errors were encountered: