-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Change search "not found" links #142867
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
Change search "not found" links #142867
Conversation
The job mingw-check-tidy
failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
Checking tidy rustdoc_json...
Running eslint on rustdoc JS files
/checkout/src/librustdoc/html/static/js/search.js
4922:1 error This line has a length of 105. Maximum allowed is 100 max-len
4923:1 error This line has a length of 107. Maximum allowed is 100 max-len
✖ 2 problems (2 errors, 0 warnings)
eslint command failed
`rustdoc-json-types` was not modified.
tidy: Skipping binary file check, read-only filesystem
##[error]tidy error: /checkout/src/librustdoc/html/static/js/search.js:4922: line longer than 100 chars
##[error]tidy error: /checkout/src/librustdoc/html/static/js/search.js:4923: line longer than 100 chars
removing old virtual environment
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10' and 'venv'
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10' and 'virtualenv'
Requirement already satisfied: pip in ./build/venv/lib/python3.10/site-packages (25.1.1)
linting python files
All checks passed!
checking python file formatting
28 files already formatted
checking C++ file formatting
some tidy checks failed
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:01:21
local time: Sun Jun 22 09:39:11 UTC 2025
network time: 2025年6月22日 09:39:11 GMT
##[error]Process completed with exit code 1.
Post job cleanup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're here we should probably disambiguate so people don't get results about the game (this happens to me sometimes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can apply some simple heuristics to hide this when it would be unhelpful. for example, if query.hasReturnArrow
is true, we're doing type-based search, like u8 -> u16
, which probably won't give much help.
This PR adds an additional link to the not found section on the search page in the rustdoc output. This new link points to
https://docs.rs/releases/search?q=*input*
.The use case is that I keep going to find an external item when unintentionally on https://doc.rust-lang.org/stable/std/. This provides a quicker way to where I actually want to search
docs.rs
.This also shows the current crate name in the section to remind the user what crate is being searched.
A concern is that the
docs.rs
search is by crate name, not by actual items. Maybe the message should beSearch crates matching *query*