Skip to content

Fix incorrect io::Take's limit resulting from io::copy specialization - #79650

Merged
bors merged 2 commits into
rust-lang:masterfrom
the8472:fix-take
Dec 6, 2020
Merged

Fix incorrect io::Take's limit resulting from io::copy specialization#79650
bors merged 2 commits into
rust-lang:masterfrom
the8472:fix-take

Conversation

@the8472

Copy link
Copy Markdown
Member

The specialization introduced in #75272 fails to update io::Take wrappers after performing the copy syscalls which bypass those wrappers. The buffer flushing before the copy does update them correctly, but the bytes copied after the initial flush weren't subtracted.

The fix is to subtract the bytes copied from each Take in the chain of wrappers, even when an error occurs during the syscall loop. To do so the CopyResult enum now has to carry the bytes copied so far in the error case.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @dtolnay

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 2, 2020
@dtolnay

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Dec 5, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit a9b1381 has been approved by dtolnay

@borsbors 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 Dec 5, 2020
@bors

bors commented Dec 6, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit a9b1381 with merge ddafcc0...

@bors

bors commented Dec 6, 2020

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: dtolnay
Pushing ddafcc0 to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Dec 6, 2020
@bors
bors merged commit ddafcc0 into rust-lang:masterDec 6, 2020
@rustbotrustbot added this to the 1.50.0 milestone Dec 6, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@the8472@rust-highfive@dtolnay@bors@rustbot