Documentation for BufRead is confusing #85394
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
rust/library/std/src/io/mod.rs
Lines 1886 to 1926 in a55748f
The doc states that
fill_buf()
needs to be paired withconsume()
to function properly, which can be comprehended to imply that ifconsume()
is not called immediately afterfill_buf()
it would cause undefined behavior.Also, it is said that later calling
read
may return the same contents. It's confusing that may is used instead of will here, and this confuses the reader to a deeper level.The text was updated successfully, but these errors were encountered: