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: allow spaces around :: in path query #118452

Merged
merged 3 commits into from Nov 30, 2023

Conversation

notriddle
Copy link
Contributor

@notriddle notriddle commented Nov 29, 2023

This restriction made sense back when spaces separated function parameters, but now that they separate path components, there's no real ambiguity any more.

Additionally, the Rust language allows it.

The other two commits are misc code cleanup.

This restriction made sense back when spaces separated function
parameters, but now that they separate path components, there's
no real ambiguity any more.

Additionally, the Rust language allows it.
This is already covered by the normal unexpected char path.
This way, most of the parsing code doesn't need to be designed to handle
it, since they should always be treated exactly the same anyhow.
@rustbot
Copy link
Collaborator

rustbot commented Nov 29, 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 Nov 29, 2023
@rustbot
Copy link
Collaborator

rustbot commented Nov 29, 2023

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @jsha

@notriddle notriddle changed the title rustdoc-search: allow :: and :: rustdoc-search: allow spaces around :: in path query Nov 29, 2023
@GuillaumeGomez
Copy link
Member

I don't agree with this change. I think not allowing whitespace characters in paths makes more sense:

  • closer to rust code
  • less weird to read

@notriddle
Copy link
Contributor Author

closer to rust code

Rust allows you to put spaces around the :: in paths. It's not even a warning, just different from what Rustfmt does by default.

More important than consistency with Rust, though, is consistency with itself. The search engine already allows Vec < primitive : u8 >. It's just :: that can't have spaces around it.

less weird to read

It's a search query. Most of the time, nobody but the person who writes the query will ever see it.

@jsha
Copy link
Contributor

jsha commented Nov 29, 2023

I agree with @notriddle on this.

@GuillaumeGomez
Copy link
Member

closer to rust code

Rust allows you to put spaces around the :: in paths. It's not even a warning, just different from what Rustfmt does by default.

I didn't know that. Then I'm all in favour for this change. 👍

@GuillaumeGomez
Copy link
Member

I'm not sure if an FCP is needed here. I'll let you decide on this. r=me otherwise.

@notriddle
Copy link
Contributor Author

@bors r=GuillaumeGomez,jsha

@bors
Copy link
Contributor

bors commented Nov 30, 2023

📌 Commit 930cba8 has been approved by GuillaumeGomez,jsha

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 Nov 30, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 30, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#118452 (rustdoc-search: allow spaces around `::` in path query)
 - rust-lang#118453 (Tweak message on ADT with private fields building)
 - rust-lang#118456 (rustc_span: Remove unused symbols.)
 - rust-lang#118458 (rustdoc: remove small from  `small-section-header`)
 - rust-lang#118464 (Dispose llvm::TargetMachines prior to llvm::Context being disposed)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e9a870d into rust-lang:master Nov 30, 2023
11 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 30, 2023
@bors
Copy link
Contributor

bors commented Nov 30, 2023

⌛ Testing commit 930cba8 with merge 1670ff6...

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 30, 2023
Rollup merge of rust-lang#118452 - notriddle:coloncolonspace, r=GuillaumeGomez,jsha

rustdoc-search: allow spaces around `::` in path query

This restriction made sense back when spaces separated function parameters, but now that they separate path components, there's no real ambiguity any more.

Additionally, the Rust language allows it.

The other two commits are misc code cleanup.
@notriddle notriddle deleted the coloncolonspace branch November 30, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

5 participants