Potential footgun in ReadBuf being mem::replaced. #2827
Labels
A-tokio
Area: The main tokio crate
C-maintenance
Category: PRs that clean code up or issues documenting cleanup.
M-io
Module: tokio/io
Milestone
In tokio 0.3, we've adopted the new
ReadBuf
API forAsyncRead
. It's been noticed that there is a potential footgun if an implementor replaces theReadBuf
with a different buffer.Original issue: rust-lang/rfcs#2930 (comment)
Example
One possible solution is to point out that a user should check
buf.filled().as_ptr()
is still the same.The text was updated successfully, but these errors were encountered: