Skip to content

Tracking Issue for alloc::io and core::io #154046

Open

Description

@a1phyr

View all comments

Feature gate: #![feature(alloc_io)]

This is a tracking issue for using module io in alloc (and hopefully in core one day).

Public API

alloc::io and core::io modules.

Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩

Activity

  1. added
    T-libs-api[DEPRECATED; DO NOT USE]
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Mar 18, 2026
  2. changed the title [-]Tracking Issue for `alloc::io`[/-] [+]Tracking Issue for `alloc::io` and `core::io`[/+] on Mar 19, 2026
  3. Mark-Simulacrum commented on Apr 11, 2026

    @Mark-Simulacrum
    Member

    In #154654, we noted that core::io is currently gated with the feature gate core_io_borrowed_buf (code).

    I would like to propose we stabilize core::io and alloc::io existing while leaving the contents unstable for now. That would avoid users needing to add multiple feature gates, and I think it's highly likely those names will remain in existence (and eventually have contents). Can libs-api approve that, either via FCP or just commenting here (since we're just stabilizing the modules not convinced a 10+ day wait is really needed).

  4. Amanieu commented on Apr 14, 2026

    @Amanieu
    Member

    We discussed this in the @rust-lang/libs-api meeting. We're not inclined to stabilize these modules before at least one item is stabilized inside them.

    If excessive feature gates are a concern, this could be simplified by just having a single core_io feature that covers anything in core::io that is already stable today.

  5. added 2 commits that reference this issue on Apr 19, 2026
  6. added a commit that references this issue on Apr 20, 2026
  7. added a commit that references this issue on Apr 20, 2026
  8. bushrat011899 commented on Apr 23, 2026

    @bushrat011899
  9. added a commit that references this issue on Apr 24, 2026
  10. 111 remaining items

  11. nia-e commented on Aug 11, 2026

    @nia-e
    Member

    Per today's libs meeting, we'd be happy to start FCP on a stabilisation PR for the above ^^ @bushrat011899 feel free to open one & ping us there

  12. programmerjake commented on Aug 11, 2026

    @programmerjake
    Member

    Per today's libs meeting, we'd be happy to start FCP on a stabilisation PR for the above ^^ @bushrat011899 feel free to open one & ping us there

    I'm assuming by "above ^^" you mean #154046 (comment)?

  13. bushrat011899 commented on Aug 11, 2026

    @bushrat011899
    Contributor

    Per today's libs meeting, we'd be happy to start FCP on a stabilisation PR for the above ^^ @bushrat011899 feel free to open one & ping us there

    Excellent, will open one shortly!

    I'm assuming by "above ^^" you mean #154046 (comment)?

    That's how I interpret it as well, especially reading the meeting notes.

  14. nia-e commented on Aug 11, 2026

    @nia-e
    Member

    yep, that's correct

  15. added 2 commits that reference this issue on Aug 12, 2026
  16. added a commit that references this issue on Aug 12, 2026
  17. added
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    and removed
    T-libs-api[DEPRECATED; DO NOT USE]
    on Aug 12, 2026
  18. NamorNiradnug commented on Aug 21, 2026

    @NamorNiradnug

    A thought on Read in core. Consider the following solution:

    // core::io
    pub trait Read { ... }
    
    // alloc::io
    pub trait Read: core::io::Read { ... }
    
    // std::io
    pub trait Read { ... }
    impl<R: core::io::Read> Read for R { ... }

    This seems to be non-breaking and allows new code to implement core::io::Read and alloc::io::Read while remaining compatible with the existing code that requires std::io::Read. It is quite close to the "perfect" solution that requires auto impl:

    // core::io
    pub trait Read { ... }
    
    // alloc::io
    pub trait Read: core::io::Read {
        auto impl core::io::Read;
        ...
    }
    
    // std::io
    pub use alloc::io::Read;

    We could use the first solution until auto impl arrives and then switch the the second one. The switch should be non-breaking (at least I don't see what could break). The only issue I see is that the first solution encourages users to write

    impl core::io::Read for MyRead { ... }
    impl alloc::io::Read for MyRead {} // this line is not nice
  19. tisonkun commented on Sep 7, 2026

    @tisonkun
    Contributor

    I wonder after #160951, we may stablize core::io::Write as well since it doesn't have the issue as io::Read has?

    It helps downstream project to avoid std dependency if only std::io::Write is involved. For example, https://github.com/fast/hashcrew/blob/dbf7916c5da3927edf4bef35c1b2d4db7ded866d/hashcrew/src/xxhash/xxh64.rs#L247-L259.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions