Skip to content

Implement unread_byte for byte_buf #2738

Closed

Description

@catamorphism

In the impl of reader for byte_buf, in core::io, unread_byte currently fails with an "implemented" message.

Activity

  1. eholk commented on Jun 28, 2012

    @eholk
    Contributor

    This should be pretty easy to fix. I think it basically just needs to call vec::unshift on the underlying vector.

  2. catamorphism commented on Nov 24, 2012

    @catamorphism
    ContributorAuthor

    n.b. byte_buf is now BytesReader.

  3. catamorphism commented on Nov 24, 2012

    @catamorphism
    ContributorAuthor

    I tried to do this, but I got confused. Since BytesReader wraps an immutable vector, I don't see a safe way to implement unread_byte. Do we even need it? I don't see it used anywhere.

  4. erickt commented on Nov 24, 2012

    @erickt
    Contributor

    I'm fine with removing it. How about we remove it, and make an issue to add a Writer wrapper that adds support for unreading bytes/chars?

  5. catamorphism commented on Nov 24, 2012

    @catamorphism
    ContributorAuthor

    Sounds like a plan!

  6. erickt commented on Nov 24, 2012

    @erickt
    Contributor

    Here it is: #4031.

  7. removed their assignment
    on Jun 16, 2014
  8. added a commit that references this issue on Dec 24, 2022
  9. rust-log-analyzer commented on Dec 24, 2022

    @rust-log-analyzer
    Collaborator

    The job mingw-check failed! Check out the build log: (web) (plain)

    Click to see the possible cause of the failure (guessed by this bot)
    configure: rust.debug-assertions := True
    configure: rust.overflow-checks := True
    configure: llvm.assertions      := True
    configure: dist.missing-tools   := True
    configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
    configure: writing `config.toml` in current directory
    configure: 
    configure: run `python /checkout/x.py --help`
    Attempting with retry: make prepare
    ---
        Checking tracing-error v0.2.0
    error: lifetime parameter `'tcx` never used
      --> src/tools/miri/src/shims/unix/linux/fd/epoll.rs:39:12
       |
    39 |     fn dup<'tcx>(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
       |           -^^^^- help: elide the unused lifetime
       |
       = note: `-D unused-lifetimes` implied by `-D warnings`
    error: lifetime parameter `'tcx` never used
      --> src/tools/miri/src/shims/unix/linux/fd/event.rs:24:12
       |
       |
    24 |     fn dup<'tcx>(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
       |           -^^^^- help: elide the unused lifetime
    error: lifetime parameter `'tcx` never used
      --> src/tools/miri/src/shims/unix/linux/fd/socketpair.rs:18:12
       |
       |
    18 |     fn dup<'tcx>(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
       |           -^^^^- help: elide the unused lifetime
        Checking color-spantrace v0.2.0
        Checking addr2line v0.17.0
        Checking color-eyre v0.6.2
        Checking ui_test v0.5.0
    
  10. added a commit that references this issue on Jan 6, 2023
  11. added a commit that references this issue on Jan 29, 2026
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

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions