Uh oh!
There was an error while loading. Please reload this page.
Implement more traits for std::io::ErrorKind - #35911
Conversation
This makes it possible to use it as key in various maps.
rust-highfive
commented
Aug 23, 2016
(rust_highfive has picked a reviewer for you, use r? to override) |
alexcrichton
commented
Aug 23, 2016
Could you expand on the motivation of being able to use in various maps as well? One specific aspect here was to reorder the enum, and it seems like we would want to provide zero guarantees about the ordering of this enum. |
tbu-
commented
Aug 23, 2016
I write a tool that operates on a large number of files, and it tries to display an error summary at the end. Currently, I have an almost-exact mirror of the Do we guarantee that the ordering stays the same for types that derive ordering? I don't think that's all too useful, because we also don't want to guarantee the ordering for other enums where you can obtain it by casting it to an integer ( |
Stebalien
commented
Aug 23, 2016
(IMO, these methods should all panic when called on |
ollie27
commented
Aug 23, 2016
If we're not supposed to have any guarantees about the ordering of this enum then it probably shouldn't be a C-Like enum. We're currently exposing an ordering: |
Stebalien
commented
Aug 23, 2016
@ollie27 (that also means that this change cannot reorder fields without being a breaking change). |
tbu-
commented
Aug 24, 2016
@Stebalien I don't think we consider that a breaking change, see e.g. #25246 or rust-lang/rfcs#906. It doesn't realistically break any code. |
sfackler
commented
Aug 24, 2016
I don't really see why we'd want to reorder these variants? |
tbu-
commented
Aug 24, 2016
Just for consistency I guess, but I can remove that part. I thought |
tbu-
commented
Aug 24, 2016
To clarify, this was ment as a drive-by fix, not part of the whole pull request. I restored the old ordering because apparantly this is not a tiny change. |
alexcrichton
commented
Aug 29, 2016
@bors: r+ |
bors
commented
Aug 29, 2016
📌 Commit c2d064e has been approved by |
sophiajt
commented
Aug 31, 2016
@bors rollup |
…crichton Implement more traits for `std::io::ErrorKind` This makes it possible to use it as key in various maps.
This makes it possible to use it as key in various maps.