Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upFmt flags refactor #24492
Conversation
richo
added some commits
Apr 16, 2015
rust-highfive
assigned
alexcrichton
Apr 16, 2015
This comment has been minimized.
This comment has been minimized.
|
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
Err, tbc this is WIP. I had a moment and opened the PR before running the tests, which I have undoubtedly broken. Open to feedback on the spirit of the PR though! |
richo
added some commits
Apr 16, 2015
This comment has been minimized.
This comment has been minimized.
|
Due to the unstable internals, this shouldn't need to bother with a |
This comment has been minimized.
This comment has been minimized.
|
That sounds reasonable (And definitely lines up with my experience once I started getting fmt_macros to work around this). Is the correct move forward an RFC or a thread on internals? I care about this enough to shepard it. |
This comment has been minimized.
This comment has been minimized.
|
A thread on internals is probably fine for now, I suspect that the two main options here would be specific |
This comment has been minimized.
This comment has been minimized.
|
Closing for now in favour of http://internals.rust-lang.org/t/stabilising-formatter-flags/1927 |
richo commentedApr 16, 2015
While implementing the fmt::Pointer traits, needing to awkwardly bitshift the variants of an enum everywhere irked me as being very awkward. Considering these values are never passed as arguments, it's not like their membership in the enum actually grants any type safety.
bitflags is not available in core, so I manually created the bitflags. This shouldn't break existing code, since they're not exported, but it seems that they should be, since there doesn't appear to be a blessed way to test for, eg the alternate flag in a formatter in user code.