You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I-heavyIssue: 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.
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 formatting core::panic::Location costs amlost 3 KiB in binary. This is because inefficient impl Display for u32. Also see: https://github.com/dtolnay/itoa
fmease
added
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
and removed
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Dec 17, 2023
At present, both {} and (e.g.) {:06} pass the integer to Argument::new_display, which returns a pointer to Display::fmt unconditionally. new_display doesn't see whether this has extra flags or not so it has no opportunity to return a simplified formatting function. You would have to change format_args to give new_display visibility of the Placeholder struct to allow a specialized formatting function to be returned instead. (Edit: a new_simple_display was tried in #104525 but not merged, with tracking issue #99012.)
I-heavyIssue: 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.
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: