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

rustdoc: search results show promising result, but referent page doesn't contain the named method. #66164

Closed
nathan-at-least opened this issue Nov 6, 2019 · 4 comments
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@nathan-at-least
Copy link

Summary: I search API docs, see a promising result, follow that result to a page, that page does not have the method nor description text that was in the search result. Verified in local docs and officially hosted docs.rs docs.

Details:

I originally filed this issue in the tokio repo thinking it was an API doc bug on their part. Someone suggested it's a rust-doc bug, so here I am. The original issue has a fair amount of detail: tokio-rs/tokio#1738

Reproduction:

I haven't literally tested this yet, but I believe it's on the right track:

$ cargo new docbugdemo
$ cd ./docbugdemo
$ echo 'tokio = "0.2.0-alpha.6" >> Cargo.toml
$ cargo doc --open

-then search for next or _::next, and follow the top hit. On the resulting page use browser find-in-page-search for "next". Observe 0 hits. View the source of that module, use browser find-in-page for "next". Observe 0 hits.

Investigation:

I'm missing a lot of context here with both rust-doc and tokio API, but I wonder if some of these could be contributors to the bug:

  • tokio re-exports a lot.
  • Maybe tokio defines multiple different _ traits or types in different modules?
  • Maybe the name _ happens to confuse rust-doc.

Related Issues:
I searched this repo with label:T-rustdoc search and scanned for duplicates/related items. I believe this bug is unique.

Two relevant results:

@jonas-schievink
Copy link
Contributor

This might be a duplicate of #66046. What's the method in the search results you clicked on?

@nathan-at-least
Copy link
Author

In the linked original issue, tokio-rs/tokio#1738, there are screen shots that show the highlighted result I followed, which is to tokio::prelude::_::next.

To me it doesn't sound like #66046 is a duplicate, because when I view the source link of the referent page, there's literally no "next" anywhere in the source, so this doesn't seem like a case of a hidden / folded doc item.

@nathan-at-least
Copy link
Author

Hey, I just realized there are multiple extension traits imported as _, starting with this line: https://docs.rs/tokio/0.2.0-alpha.6/src/tokio/prelude.rs.html#14

Could it be that this confuses the search indexing?

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 7, 2019
@jyn514
Copy link
Member

jyn514 commented Apr 8, 2021

Duplicate of #61592, fixed by #80267.

@jyn514 jyn514 closed this as completed Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants