Skip to content
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

Implement read_buf for a few more types #108326

Merged
merged 1 commit into from
Mar 21, 2023
Merged

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Feb 21, 2023

Implement read_buf for TcpStream, Stdin, StdinLock, ChildStdout,
ChildStderr (and internally for AnonPipe, Handle, Socket), so
that it skips buffer initialization.

The other provided methods like read_to_string and read_to_end are
implemented in terms of read_buf and so benefit from the optimization
as well.

This commit also implements read_vectored and is_read_vectored where
applicable.

@rustbot
Copy link
Collaborator

rustbot commented Feb 21, 2023

r? @thomcc

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 21, 2023
@tmiasko tmiasko marked this pull request as ready for review February 21, 2023 22:20
@rustbot
Copy link
Collaborator

rustbot commented Feb 21, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@tmiasko tmiasko force-pushed the read-buf branch 2 times, most recently from b19428f to 94a1cc0 Compare February 21, 2023 22:24
@rust-log-analyzer

This comment has been minimized.

@tmiasko tmiasko force-pushed the read-buf branch 2 times, most recently from 8877d4b to 58fb78b Compare February 21, 2023 22:50
@thomcc
Copy link
Member

thomcc commented Feb 22, 2023

Does this change stable API? It probably should have an ACP regardless...

@tmiasko
Copy link
Contributor Author

tmiasko commented Feb 22, 2023

There are no changes in public API. It only optimizes the implementation of read_buf (the provided implementation initializes the buffer completely and delegates to read).

@thomcc
Copy link
Member

thomcc commented Feb 22, 2023

Oh right, of course. Sorry, I'll take a look later.

@thomcc
Copy link
Member

thomcc commented Feb 26, 2023

Yeah these seem fine. I don't think it's worth blocking rollup since I doubt these types are used much in the compiler.

@bors r+

@bors
Copy link
Contributor

bors commented Feb 26, 2023

📌 Commit 8ffb6af has been approved by thomcc

It is now in the queue for this repository.

@bors bors added 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-review Status: Awaiting review from the assignee but also interested parties. labels Feb 26, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 26, 2023
Implement read_buf for a few more types

Implement read_buf for TcpStream, Stdin, StdinLock, ChildStdout,
ChildStderr (and internally for AnonPipe, Handle, Socket), so
that it skips buffer initialization.

The other provided methods like read_to_string and read_to_end are
implemented in terms of read_buf and so benefit from the optimization
as well.

This commit also implements read_vectored and is_read_vectored where
applicable.
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Feb 26, 2023
Implement read_buf for a few more types

Implement read_buf for TcpStream, Stdin, StdinLock, ChildStdout,
ChildStderr (and internally for AnonPipe, Handle, Socket), so
that it skips buffer initialization.

The other provided methods like read_to_string and read_to_end are
implemented in terms of read_buf and so benefit from the optimization
as well.

This commit also implements read_vectored and is_read_vectored where
applicable.
@compiler-errors
Copy link
Member

Failed in a rollup:

#108509 (comment)

@bors r-

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 27, 2023
@thomcc
Copy link
Member

thomcc commented Mar 21, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Mar 21, 2023

📌 Commit defa245 has been approved by thomcc

It is now in the queue for this repository.

@bors bors added 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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 21, 2023
@bors
Copy link
Contributor

bors commented Mar 21, 2023

⌛ Testing commit defa245 with merge 571328f5d7d4561541e1c5af0884a29b3adbbff1...

@bors
Copy link
Contributor

bors commented Mar 21, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 21, 2023
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
[2616/3021] Linking CXX static library lib\libLLVMWebAssemblyDisassembler.a
[2617/3021] Linking CXX static library lib\libLLVMPowerPCCodeGen.a
[2618/3021] Linking CXX static library lib\libLLVMSystemZCodeGen.a
[2619/3021] Linking CXX static library lib\libLLVMAVRCodeGen.a
FAILED: lib/libLLVMAVRCodeGen.a 
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E rm -f lib\libLLVMAVRCodeGen.a && C:\a\rust\rust\mingw32\bin\ar.exe qc lib\libLLVMAVRCodeGen.a  lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRAsmPrinter.cpp.obj lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRExpandPseudoInsts.cpp.obj lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRFrameLowering.cpp.obj lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRInstrInfo.cpp.obj lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRISelDAGToDAG.cpp.obj lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRISelLowering.cpp.obj lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRMCInstLower.cpp.obj lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRRegisterInfo.cpp.obj lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRShiftExpand.cpp.obj lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRSubtarget.cpp.obj lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRTargetMachine.cpp.obj lib/Target/AVR/CMakeFiles/LLVMAVRCodeGen.dir/AVRTargetObjectFile.cpp.obj && C:\a\rust\rust\mingw32\bin\ranlib.exe lib\libLLVMAVRCodeGen.a && cd ."
C:\a\rust\rust\mingw32\bin\ranlib.exe: could not create temporary file whilst writing archive: no more archived files
[2620/3021] Linking CXX static library lib\libLLVMWebAssemblyCodeGen.a
[2621/3021] Linking CXX static library lib\libLLVMM68kCodeGen.a
[2622/3021] Linking CXX static library lib\libLLVMX86CodeGen.a
[2623/3021] Linking CXX executable bin\llvm-profdata.exe
[2623/3021] Linking CXX executable bin\llvm-profdata.exe
[2624/3021] Building CXX object tools/llc/CMakeFiles/llc.dir/llc.cpp.obj
[2625/3021] Building CXX object tools/lli/CMakeFiles/lli.dir/lli.cpp.obj
[2626/3021] Linking CXX static library lib\libLLVMPasses.a
ninja: build stopped: subcommand failed.
command did not execute successfully, got: exit code: 1


build script failed, must exit now', C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1cd66030c949c28d\cmake-0.1.48\src\lib.rs:975:5
 finished in 299.801 seconds
Build completed unsuccessfully in 0:06:13
Build completed unsuccessfully in 0:06:13
make: *** [Makefile:80: ci-mingw-subset-2] Error 1

@tmiasko
Copy link
Contributor Author

tmiasko commented Mar 21, 2023

@bors retry #108227

@bors bors added 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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 21, 2023
@Nilstrieb
Copy link
Member

The queue is pretty full, let's try rolling it up anyways so the rollup=always PRs can use the CI time from this
@bors rollup=iffy

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 21, 2023
Rollup of 10 pull requests

Successful merges:

 - rust-lang#106434 (Document `Iterator::sum/product` for Option/Result)
 - rust-lang#108326 (Implement read_buf for a few more types)
 - rust-lang#108842 (Enforce non-lifetime-binders in supertrait preds are not object safe)
 - rust-lang#108896 (new solver: make all goal evaluation able to be automatically rerun )
 - rust-lang#109124 (Add `dist.compression-profile` option to control compression speed)
 - rust-lang#109240 (Walk un-shifted nested `impl Trait` in trait when setting up default trait method assumptions)
 - rust-lang#109385 (fix typo)
 - rust-lang#109386 (add myself to mailmap)
 - rust-lang#109390 (Custom MIR: Support aggregate expressions)
 - rust-lang#109408 (not *all* retags might be explicit in Runtime MIR)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Mar 21, 2023

⌛ Testing commit defa245 with merge a01b4cc...

@bors bors merged commit 82dc127 into rust-lang:master Mar 21, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 21, 2023
@tmiasko tmiasko deleted the read-buf branch March 21, 2023 14:51
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Apr 2, 2023
In principle, this PR extends rust-lang#108326 for RustyHermit.

Signed-off-by: Stefan Lankes <slankes@eonerc.rwth-aachen.de>
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 2, 2023
Implement read_buf for RustHermit

In principle, this PR extends rust-lang#108326 for RustyHermit.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 3, 2023
Implement read_buf for RustHermit

In principle, this PR extends rust-lang#108326 for RustyHermit.
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Apr 12, 2023
…ad-buf, r=cuviper

kmc-solid: Implement `Socket::read_buf`

Follow-up to rust-lang#108326. Implements `Socket::read_buf` for the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets.
thomcc pushed a commit to tcdi/postgrestd that referenced this pull request Jun 1, 2023
In principle, this PR extends rust-lang/rust#108326 for RustyHermit.

Signed-off-by: Stefan Lankes <slankes@eonerc.rwth-aachen.de>
thomcc pushed a commit to tcdi/postgrestd that referenced this pull request Jun 1, 2023
Implement read_buf for RustHermit

In principle, this PR extends rust-lang/rust#108326 for RustyHermit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants