Stream: project-error-handling

Topic: Study of io::Error


view this post on Zulip DPC (Oct 15 2020 at 01:47):

Interesting article that might be relevant to our group:https://matklad.github.io/2020/10/15/study-of-std-io-error.html

view this post on Zulip oliver (Oct 15 2020 at 13:41):

"error kitchensinkosis" :joy:

view this post on Zulip Jakub Duchniewicz (Oct 20 2020 at 07:58):

Nice article, it is quite interesting how intricate the design of such types is:

view this post on Zulip Jakub Duchniewicz (Oct 20 2020 at 07:59):

it is mentioned that the size of std::io::Error can be fixed, is there any movement happening concerning it? Or is it not our concern

view this post on Zulip Jakub Duchniewicz (Oct 20 2020 at 08:00):

I am quite confused by the proposition:

Second, we can make use of the fact that pointers are aligned, and stash both Os and Simple variants into usize with the least significant bit set.
I think we can even get creative and use the second least significant bit, leaving the first one as a niche. That way, even something like io::Result<i32> can be pointer-sized!

view this post on Zulip Jakub Duchniewicz (Oct 20 2020 at 08:02):

is he proposing some kind of union'ing?

view this post on Zulip Jakub Duchniewicz (Oct 20 2020 at 08:02):

And yeah, I know I may be late to party with my replies :happy:

view this post on Zulip oliver (Oct 20 2020 at 15:34):

what is confusing you?

view this post on Zulip Joshua Nelson (Oct 20 2020 at 16:01):

Jakub Duchniewicz said:

Nice article, it is quite interesting how intricate the design of such types is:

https://github.com/rust-lang/rust/issues/77960

view this post on Zulip Jakub Duchniewicz (Oct 20 2020 at 17:10):

oliver said:

what is confusing you?

this particular bit fiddling with LSB and second LSB


Last updated: Jan 26 2022 at 14:46 UTC