Implement most of RFC 2930, providing the ReadBuf abstraction by beepster4096 · Pull Request #81156 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation107 Commits12 Checks0 Files changed

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

[ Show hidden characters]({{ revealButtonHref }})

beepster4096

This replaces the Initializer abstraction for permitting reading into uninitialized buffers, closing #42788.

This leaves several APIs described in the RFC out of scope for the initial implementation:

Closes #42788, by removing the relevant APIs.

fee1-dead, gilescope, andylizi, goffrie, paolobarbolini, Kobzol, gustav3d, and Yanhao reacted with thumbs up emoji hkratz, Kobzol, RalfJung, gilescope, and scottlamb reacted with hooray emoji iago-lito and gilescope reacted with heart emoji

@rust-highfive

r? @kennytm

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-log-analyzer

This comment has been minimized.

@jyn514

@drmeepster do you mind squashing the commits? 41 is a lot to read through.

@beepster4096

@rust-log-analyzer

This comment has been minimized.

@beepster4096

Hopefully, weird errors in files I didn't touch don't show up this time.

@rust-log-analyzer

This comment has been minimized.

@beepster4096

uh I think this PR is cursed

@rust-log-analyzer

This comment has been minimized.

@jyn514

uh I think this PR is cursed

We debugged this locally, here's an MCVE:

> cat doctest.rs
//! ```
//! extern crate proc_macro;
//!
//! # fn main() {}
//! ```
> rustdoc +rustc2 --test doctest.rs 

running 1 test
test doctest.rs - (line 1) ... FAILED

failures:

---- doctest.rs - (line 1) stdout ----
error: expected one of `;` or `as`, found `<eof>`
 --> doctest.rs:2:14
  |
2 | extern crate p
  |              ^ expected one of `;` or `as`

Notice how the error unexpectedly cuts off after crate p. So it's at least feasible it's related to this PR - either Rustdoc has UB or one of the changes introduced a logic error. It's strange that this only happens for rustdoc and not rustc.

@beepster4096

The remove unresolved import commit passing CI means that the error is caused by the changes to BufReader

@djc

Very excited, thanks for working on this! I don't have a lot of experience with larger std changes like this, but I feel like it would be easier to land this if you focused on getting an initial PR merged that only includes the ReadBuf implementation (plus tests), and leave usage of the new type to future PRs (can still keep your changes, of course!).

@bors

This comment has been minimized.

@bors

This comment has been minimized.

@bors

This comment has been minimized.

@kennytm

@bstrie

@anp anp mentioned this pull request

Apr 7, 2021

@nrc

As far as I can tell, parts of this are insta-stable, and thus need an FCP

@joshtriplett which parts will be insta-stable?

@joshtriplett

We reviewed this in today's @rust-lang/libs-api meeting, and confirmed that there are no insta-stable bits of this. We do see two potential issues with this that should be covered and addressed in the tracking issue:

However, since this isn't insta-stable, we can address both of those through further development on nightly.

@rfcbot cancel

@bors r+

@rfcbot

@bors

📌 Commit cd23799 has been approved by joshtriplett

@bors bors added disposition-merge

This issue / PR is in PFCP or FCP with a disposition to merge it.

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Dec 8, 2021

@Mark-Simulacrum Mark-Simulacrum changed the titleImplement (most of) RFC 2930 "Reading into uninitialized buffers" (ReadBuf) Implement most of RFC 2930, providing the ReadBuf abstraction

Dec 9, 2021

@Mark-Simulacrum

FWIW, I think it would be nice to squash the commits here, but it doesn't seem worth blocking over and it looks like the feature letting upstream maintainers push to the branch isn't turned on for this PR.

@bors

@bors

@bors bors mentioned this pull request

Dec 9, 2021

9 tasks

@nrc nrc mentioned this pull request

Dec 9, 2021

This was referenced

Dec 9, 2021

@rust-timer

Finished benchmarking commit (3b263ce): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

RalfJung

//
// - Only the standard library gets to soundly "ignore" this,
// based on its privileged knowledge of unstable rustc
// internals;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I am so happy to see this comment disappear. :)

jyn514, lqd, nrc, beepster4096, saethlin, mejrs, andylizi, shirshak55, iago-lito, WaffleLapkin, and 3 more reacted with laugh emoji

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Dec 22, 2021

@matthiaskrgr

@Urgau Urgau mentioned this pull request

Jan 25, 2022

Labels

disposition-merge

This issue / PR is in PFCP or FCP with a disposition to merge it.

merged-by-bors

This PR was explicitly merged by bors.

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-libs-api

Relevant to the library API team, which will review and decide on the PR/issue.