You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
std::io::Read incorrectly has no marked required methods #163675
Technically at least one ofread or the unstable read_buf must be implemented, and the default implementations of those methods use each other. You can see this in the error message when you fail to implement them:
error[E0046]: not all trait items implemented, missing one of: `read_buf`, `read`
--> src/main.rs:16:1
|
16 | impl std::io::Read for MyStruct {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing one of `read_buf`, `read` in implementation
Because both of these methods have a default implementation, they're not considered "required" by rustdoc. It should probably parse #[rustc_must_implement_one_of(read_buf, read)] and display this somehow (no idea how to concisely represent this).
@AlaskanEmily@asquared31415 when a trait has #[rustc_must_implement_one_of], show the
"Required Methods" entry in the sidebar (linking to the existing section).
Would you also want the declaration comment changed, or is the sidebar
enough?
Activity
asquared31415 commentedon Oct 2, 2026
Technically at least one of
reador the unstableread_bufmust be implemented, and the default implementations of those methods use each other. You can see this in the error message when you fail to implement them:Because both of these methods have a default implementation, they're not considered "required" by rustdoc. It should probably parse
#[rustc_must_implement_one_of(read_buf, read)]and display this somehow (no idea how to concisely represent this).@rustbot label +T-rustdoc -needs-triage
integral-830 commentedon Oct 4, 2026
@rustbot claim
integral-830 commentedon Oct 5, 2026
@AlaskanEmily @asquared31415 when a trait has #[rustc_must_implement_one_of], show the
"Required Methods" entry in the sidebar (linking to the existing section).
Would you also want the declaration comment changed, or is the sidebar
enough?
GuillaumeGomez commentedon Oct 13, 2026
This issue was already kinda solved. Opened #164266 to cover the missing bits.
Rollup merge of rust-lang#164266 - GuillaumeGomez:rustc_must_implemen…
Rollup merge of rust-lang#164266 - GuillaumeGomez:rustc_must_implemen…
Rollup merge of rust-lang#164266 - GuillaumeGomez:rustc_must_implemen…
Rollup merge of rust-lang#164266 - GuillaumeGomez:rustc_must_implemen…
Rollup merge of rust-lang#164266 - GuillaumeGomez:rustc_must_implemen…
Unrolled build for #164266 in rollup 164322
Rollup merge of #164266 - GuillaumeGomez:rustc_must_implement_one_of,…