-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Documentation for BufRead is confusing #85394
Copy link
Copy link
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
readmay return the same contents. It's confusing that may is used instead of will here, and this confuses the reader to a deeper level.