rust icon indicating copy to clipboard operation
rust copied to clipboard

Some trait methods don't appear in the documentation for types that implement the trait

Open ahjones opened this issue 1 year ago • 2 comments
trafficstars

Location

This is a documentation bug on this page specifically:

https://doc.rust-lang.org/std/io/struct.BufReader.html#impl-BufRead-for-BufReader%3CR%3E

I believe I've seen the same issue elsewhere, but I don't have an example to hand right now.

Summary

Here's a specific example: the doc for Bufreader doesn't include the method lines in the Bufreader impl section. Other methods like has_data_left are documented. Both has_data_left and lines are default methods, and yet only one of them is described.

It's causing an issue because I can't find if a method is implemented on a structure by searching through the structure's documentation.

ahjones avatar Oct 17 '24 15:10 ahjones

I suspect this is due to the ?Sized bound and the where Self: Sized. Seems like a bug.

Manishearth avatar Oct 17 '24 16:10 Manishearth

This is likely due to https://github.com/rust-lang/rust/pull/100221. I'll cook up some logic to make sure we handle the ambiguities correctly.

compiler-errors avatar Oct 17 '24 16:10 compiler-errors