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 no longer accepts ! as part of query #96399

Closed
jsha opened this issue Apr 25, 2022 · 4 comments · Fixed by #96430
Closed

rustdoc: search no longer accepts ! as part of query #96399

jsha opened this issue Apr 25, 2022 · 4 comments · Fixed by #96430
Assignees
Labels
A-rustdoc-search Area: Rustdoc's search feature T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jsha
Copy link
Contributor

jsha commented Apr 25, 2022

Steps to reproduce:

  1. Visit https://doc.rust-lang.org/nightly/std/string/trait.ToString.html?search=panic!

Expected result:

All versions of panic (that are macros) appear.

Actual result:

Query parse error.

Compare vs stable: https://doc.rust-lang.org/stable/std/string/trait.ToString.html?search=panic!

I think this is just a matter of accepting ! in the eBNF grammar and also the JS-implemented parser.

Note that the results on stable include modules, which arguably they shouldn't. So as an additional feature improvement we might want to recognize ! specially and treat as requiring that the results be macros (or specifically function-like macros?).

@jsha jsha added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-search Area: Rustdoc's search feature labels Apr 25, 2022
@GuillaumeGomez
Copy link
Member

Good catch! I'll send a fix tomorrow.

@notriddle
Copy link
Contributor

! on its own is not a macro. It's a primitive, and Foo<!> is a valid thing that should work. Sure, that's technically an unstable feature, but it makes more sense to ensure it works right now instead of trying to fix it later.

@GuillaumeGomez
Copy link
Member

Let's consider it valid as long as it ends the ident to simplify things then. That would make ! and macro! valid while erroring for any!thing or !!.

@camelid
Copy link
Member

camelid commented Apr 25, 2022

Note that the results on stable include modules, which arguably they shouldn't. So as an additional feature improvement we might want to recognize ! specially and treat as requiring that the results be macros (or specifically function-like macros?).

I've been meaning to suggest this for a while, so definitely a thumbs up from me :)

@bors bors closed this as completed in c0ed53c Apr 27, 2022
notriddle added a commit to notriddle/rust that referenced this issue Feb 17, 2023
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 T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants