-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
impl fmt::Display for u32 compiles to large binary #118940
Copy link
Copy link
Open
Labels
C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchI-heavyIssue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to binary size of generated code.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchI-heavyIssue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to binary size of generated code.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
My target is
wasm32-unknown-unknownbut I think it can be applied to any embedded systems. I just want to define panic handler, but formattingcore::panic::Locationcosts 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?