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: search for references #124148

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

notriddle
Copy link
Contributor

@notriddle notriddle commented Apr 19, 2024

This feature extends rustdoc with syntax and search index information for searching borrow references. Part of #60485

Preview

Updated chapter of the book: https://notriddle.com/rustdoc-html-demo-11/reference/rustdoc/read-documentation/search.html

Motivation

See #119676

Guide-level explanation

You can't search by lifetimes, but other than that it's the same syntax references normally use.

Reference-level description

Shorthand Explicit names
Before this PR
[] primitive:slice and/or primitive:array
[T] primitive:slice<T> and/or primitive:array<T>
! primitive:never
() primitive:unit and/or primitive:tuple
(T) T
(T,) primitive:tuple<T>
(T, U -> V, W) fn(T, U) -> (V, W), Fn, FnMut, and FnOnce
New additions with this PR
& primitive:reference
&mut primitive:reference<keyword:mut>
&T primitive:reference<T>
&mut T primitive:reference<keyword:mut, T>

Search query grammar

borrow-ref = AMP *WS [MUT] *WS [arg]
arg = [type-filter *WS COLON *WS] (path [generics] / slice-like / tuple-like / borrow-ref)

AMP = "&"
MUT = "mut"

Future direction

As described in #118194 and #119676

  • The remaining type expression grammar (this is another step in the type expression grammar: ReferenceType is now supported)
  • Search subtyping and traits

@rustbot
Copy link
Collaborator

rustbot commented Apr 19, 2024

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 19, 2024
@rustbot
Copy link
Collaborator

rustbot commented Apr 19, 2024

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @jsha

@GuillaumeGomez
Copy link
Member

Looks good to me, thanks! Since it extends the search capabilities, let's start an FCP.

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented Apr 22, 2024

Team member @GuillaumeGomez has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Apr 22, 2024
@rfcbot
Copy link

rfcbot commented Apr 25, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants