Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Fix incorrect io::Take's limit resulting from io::copy specialization #79650
Conversation
r? @dtolnay (rust-highfive has picked a reviewer for you, use r? to override) |
@bors r+ |
|
|
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 theCopyResult
enum now has to carry the bytes copied so far in the error case.