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: add support for type filters in arguments and generics #108629

Merged
merged 2 commits into from
Mar 24, 2023

Conversation

notriddle
Copy link
Contributor

This makes sense, since the search index has the information in it, and it's more useful for function signature searches since a function signature search's item type is, by definition, some type of function (there's more than one, but not very many).

@rustbot
Copy link
Collaborator

rustbot commented Mar 1, 2023

r? @jsha

(rustbot has picked a reviewer for you, use r? to override)

@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 Mar 1, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 1, 2023

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

@notriddle notriddle force-pushed the notriddle/item-type-advanced branch 2 times, most recently from b865e9b to 551dbbc Compare March 2, 2023 05:45
@notriddle notriddle force-pushed the notriddle/item-type-advanced branch from 1c122bd to 02d417b Compare March 3, 2023 17:17
@notriddle
Copy link
Contributor Author

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented Mar 3, 2023

Team member @notriddle 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. labels Mar 3, 2023
@GuillaumeGomez
Copy link
Member

Overall, looks good to me. Just needs an update in the help popup docs about search and eventually in the rustdoc book but I don't remember us having a chapter about search, might be worth adding one at some point.

@bors
Copy link
Contributor

bors commented Mar 3, 2023

☔ The latest upstream changes (presumably #108677) made this pull request unmergeable. Please resolve the merge conflicts.

@notriddle notriddle force-pushed the notriddle/item-type-advanced branch from 884687a to 78812cf Compare March 3, 2023 20:58
@Manishearth
Copy link
Member

Manishearth commented Mar 3, 2023

Can you post some screenshots or examples of what this actually enables?

@notriddle
Copy link
Contributor Author

Using this feature allows you to distinguish multiple items with the same name, but different kinds, when searching by function signature.

In the standard library, that's primitive:fn and trait:Fn. For another example, diesel's struct:Never is also completely different from primitive:never 1. Primitives are really the spot where you'd want this, because other kinds have paths that you'd use for disambiguation instead of using the kind.

This means I should be able to search -> struct:Never on Diesel to find ways to construct the Never struct, but that doesn't work, and -> never gives me a list of all functions that diverge.

Footnotes

  1. I do plan to open a PR in the future that desugars ! to primitive:never in the search query parser, and desugaring [T] to something like primitive:slice<T>.

@Manishearth
Copy link
Member

Ah, makes sense to me

@camelid
Copy link
Member

camelid commented Mar 6, 2023

eventually in the rustdoc book but I don't remember us having a chapter about search, might be worth adding one at some point.

We do have a small section already that could be expanded: https://doc.rust-lang.org/nightly/rustdoc/how-to-read-rustdoc.html#the-search-interface

@notriddle notriddle force-pushed the notriddle/item-type-advanced branch 3 times, most recently from 8451c01 to 163ccab Compare March 6, 2023 21:12
@notriddle notriddle added the A-rustdoc-search Area: Rustdoc's search feature label Mar 11, 2023
@bors
Copy link
Contributor

bors commented Mar 13, 2023

☔ The latest upstream changes (presumably #109056) made this pull request unmergeable. Please resolve the merge conflicts.

@notriddle notriddle force-pushed the notriddle/item-type-advanced branch 3 times, most recently from e9a2629 to 3f18ead Compare March 13, 2023 03:33
@rfcbot rfcbot added 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 Mar 13, 2023
@rfcbot
Copy link

rfcbot commented Mar 13, 2023

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

@bors
Copy link
Contributor

bors commented Mar 20, 2023

☔ The latest upstream changes (presumably #109376) made this pull request unmergeable. Please resolve the merge conflicts.

This makes sense, since the search index has the information in it,
and it's more useful for function signature searches since a
function signature search's item type is, by definition, some type
of function (there's more than one, but not very many).
@notriddle notriddle force-pushed the notriddle/item-type-advanced branch from 3f18ead to cae4385 Compare March 21, 2023 05:46
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Mar 23, 2023
@rfcbot
Copy link

rfcbot commented Mar 23, 2023

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@GuillaumeGomez
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 23, 2023

📌 Commit cae4385 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 23, 2023
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Mar 23, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 24, 2023
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#108629 (rustdoc: add support for type filters in arguments and generics)
 - rust-lang#108924 (panic_immediate_abort requires abort as a panic strategy)
 - rust-lang#108961 (Refine error spans for const args in hir typeck)
 - rust-lang#108986 (sync LVI tests)
 - rust-lang#109142 (Add block-based mutex unlocking example)
 - rust-lang#109368 (fix typo in the creation of OpenOption for RustyHermit)
 - rust-lang#109493 (Return nested obligations from canonical response var unification)
 - rust-lang#109515 (Add AixLinker to support linking on AIX)
 - rust-lang#109536 (resolve: Rename some cstore methods to match queries and add comments)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit eb46afb into rust-lang:master Mar 24, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 24, 2023
@notriddle notriddle deleted the notriddle/item-type-advanced branch March 24, 2023 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-search Area: Rustdoc's search feature disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

9 participants