IO in `core`: a (very) modest first step!

204 points ZZaaaccc 10 comments

Wanted to let people know that my PR to get std::io::ErrorKind moved into core was merged this week! I'm hoping this is the starting point to get more of std::io moved into a combination of core and alloc, which should hopefully allow for way more no_std crates in the future, especially for format crates like image.

PRs for Error, Read/Write/etc. are on the way and largely awaiting decisions around:

  • How to handle the lack of Box in core (probably storing drop functions within the heap allocations that would need to call them)
  • How to thread OS error code information back to core for Display/etc. implementations (probably a static atomic pointer, until externally implementable items is more stable)
  • Whether moving RawOSError and the IoSlice types into core/alloc is acceptable (core and alloc are supposed to be as platform independent as possible)