- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.9k
 
Add Seek::seek_relative #116750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
                
     Merged
            
            Add Seek::seek_relative #116750
Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    | 
          
 (rustbot has picked a reviewer for you, use r? to override)  | 
    
| 
           New unstable APIs need an approved API change proposal - can you file one and then poke here again once/if that's approved? @rustbot author  | 
    
              
                    m-ou-se
  
              
              reviewed
              
                  
                    Oct 17, 2023 
                  
              
              
            
            
      
        
      
      
  
    3 tasks
  
              
                    the8472
  
              
              reviewed
              
                  
                    Oct 30, 2023 
                  
              
              
            
            
| 
           I think I've addressed all the concerns that have been raised?  | 
    
| 
           @rustbot ready  | 
    
| 
           @bors r+ rollup  | 
    
    
  TaKO8Ki 
      added a commit
        to TaKO8Ki/rust
      that referenced
      this pull request
    
      Nov 18, 2023 
    
    
      
  
    
      
    
  
…k-Simulacrum Add Seek::seek_relative The `BufReader` struct has a `seek_relative` method because its `Seek::seek` implementation involved dumping the internal buffer (rust-lang#31100). Unfortunately, there isn't really a good way to take advantage of that method in generic code. This PR adds the same method to the main `Seek` trait with the straightforward default method, and an override for `BufReader` that calls its implementation. _Also discussed in [this](https://internals.rust-lang.org/t/add-seek-seek-relative/19546) internals.rust-lang.org thread._
    
  TaKO8Ki 
      added a commit
        to TaKO8Ki/rust
      that referenced
      this pull request
    
      Nov 18, 2023 
    
    
      
  
    
      
    
  
…k-Simulacrum Add Seek::seek_relative The `BufReader` struct has a `seek_relative` method because its `Seek::seek` implementation involved dumping the internal buffer (rust-lang#31100). Unfortunately, there isn't really a good way to take advantage of that method in generic code. This PR adds the same method to the main `Seek` trait with the straightforward default method, and an override for `BufReader` that calls its implementation. _Also discussed in [this](https://internals.rust-lang.org/t/add-seek-seek-relative/19546) internals.rust-lang.org thread._
    
  bors 
      added a commit
        to rust-lang-ci/rust
      that referenced
      this pull request
    
      Nov 18, 2023 
    
    
      
  
    
      
    
  
Rollup of 6 pull requests Successful merges: - rust-lang#116446 (Yeet `mir::Const::from_anon_const`) - rust-lang#116750 (Add Seek::seek_relative) - rust-lang#117110 (Suggest field typo through derefs) - rust-lang#117961 (Add `x suggest` entries for testing `mir-opt` and `coverage`) - rust-lang#118020 (Fix links to `From<{OwnedHandle, OwnedFd}> for std::process::Child{Stdin, Stdout, Stderr}` in 1.74 release notes) - rust-lang#118034 (bump few deps to fix unsoundness and drop few dup deps) r? `@ghost` `@rustbot` modify labels: rollup
    
  compiler-errors 
      added a commit
        to compiler-errors/rust
      that referenced
      this pull request
    
      Nov 18, 2023 
    
    
      
  
    
      
    
  
…k-Simulacrum Add Seek::seek_relative The `BufReader` struct has a `seek_relative` method because its `Seek::seek` implementation involved dumping the internal buffer (rust-lang#31100). Unfortunately, there isn't really a good way to take advantage of that method in generic code. This PR adds the same method to the main `Seek` trait with the straightforward default method, and an override for `BufReader` that calls its implementation. _Also discussed in [this](https://internals.rust-lang.org/t/add-seek-seek-relative/19546) internals.rust-lang.org thread._
    
  bors 
      added a commit
        to rust-lang-ci/rust
      that referenced
      this pull request
    
      Nov 18, 2023 
    
    
      
  
    
      
    
  
Rollup of 5 pull requests Successful merges: - rust-lang#116750 (Add Seek::seek_relative) - rust-lang#117110 (Suggest field typo through derefs) - rust-lang#117961 (Add `x suggest` entries for testing `mir-opt` and `coverage`) - rust-lang#118020 (Fix links to `From<{OwnedHandle, OwnedFd}> for std::process::Child{Stdin, Stdout, Stderr}` in 1.74 release notes) - rust-lang#118034 (bump few deps to fix unsoundness and drop few dup deps) r? `@ghost` `@rustbot` modify labels: rollup
    
  rust-timer 
      added a commit
        to rust-lang-ci/rust
      that referenced
      this pull request
    
      Nov 18, 2023 
    
    
      
  
    
      
    
  
Rollup merge of rust-lang#116750 - fintelia:seek_seek_relative, r=Mark-Simulacrum Add Seek::seek_relative The `BufReader` struct has a `seek_relative` method because its `Seek::seek` implementation involved dumping the internal buffer (rust-lang#31100). Unfortunately, there isn't really a good way to take advantage of that method in generic code. This PR adds the same method to the main `Seek` trait with the straightforward default method, and an override for `BufReader` that calls its implementation. _Also discussed in [this](https://internals.rust-lang.org/t/add-seek-seek-relative/19546) internals.rust-lang.org thread._
    
  matthiaskrgr 
      added a commit
        to matthiaskrgr/rust
      that referenced
      this pull request
    
      May 13, 2024 
    
    
      
  
    
      
    
  
Stabilize `seek_seek_relative`
This PR stabilizes `seek_seek_relative`:
```rust
// std::io::Seek
trait Seek {
    fn seek_relative(&mut self, offset: i64) -> Result<()>;
}
```
<br>
Tracking issue: rust-lang#117374.
Implementation PR: rust-lang#116750.
FCPs already completed in the tracking issue.
Closes rust-lang#117374.
r? libs-api
    
    
  matthiaskrgr 
      added a commit
        to matthiaskrgr/rust
      that referenced
      this pull request
    
      May 13, 2024 
    
    
      
  
    
      
    
  
Stabilize `seek_seek_relative`
This PR stabilizes `seek_seek_relative`:
```rust
// std::io::Seek
trait Seek {
    fn seek_relative(&mut self, offset: i64) -> Result<()>;
}
```
<br>
Tracking issue: rust-lang#117374.
Implementation PR: rust-lang#116750.
FCPs already completed in the tracking issue.
Closes rust-lang#117374.
r? libs-api
    
    
  rust-timer 
      added a commit
        to rust-lang-ci/rust
      that referenced
      this pull request
    
      May 13, 2024 
    
    
      
  
    
      
    
  
Rollup merge of rust-lang#123817 - slanterns:seek_relative, r=dtolnay Stabilize `seek_seek_relative` This PR stabilizes `seek_seek_relative`: ```rust // std::io::Seek trait Seek { fn seek_relative(&mut self, offset: i64) -> Result<()>; } ``` <br> Tracking issue: rust-lang#117374. Implementation PR: rust-lang#116750. FCPs already completed in the tracking issue. Closes rust-lang#117374. r? libs-api
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      Labels
      
    S-waiting-on-bors
  Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 
  
    T-libs
  Relevant to the library team, which will review and decide on the PR/issue. 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
The
BufReaderstruct has aseek_relativemethod because itsSeek::seekimplementation involved dumping the internal buffer (#31100).Unfortunately, there isn't really a good way to take advantage of that method in generic code. This PR adds the same method to the main
Seektrait with the straightforward default method, and an override forBufReaderthat calls its implementation.Also discussed in this internals.rust-lang.org thread.