Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ahjones opened this issue Oct 17, 2024 · 2 comments · May be fixed by #131840
Open

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

ahjones opened this issue Oct 17, 2024 · 2 comments · May be fixed by #131840
Assignees
Labels
A-traits Area: Trait system C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ahjones
Copy link

ahjones commented Oct 17, 2024

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 ahjones added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Oct 17, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 17, 2024
@Manishearth
Copy link
Member

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

@compiler-errors
Copy link
Member

compiler-errors commented Oct 17, 2024

This is likely due to #100221. I'll cook up some logic to make sure we handle the ambiguities correctly.

@compiler-errors compiler-errors self-assigned this Oct 17, 2024
@fmease fmease added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-traits Area: Trait system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. and removed A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 17, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Oct 17, 2024
…<try>

Dont consider predicates that may hold as impossible in `is_impossible_associated_item`

Use infer vars to account for ambiguities when considering if methods are impossible to instantiate for a given self type. Also while we're at it, let's use the new trait solver instead of `evaluate` since this is used in rustdoc.

r? lcnr
Fixes rust-lang#131839
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-traits Area: Trait system C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
5 participants