-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Doc alias name restriction #76811
Doc alias name restriction #76811
Conversation
r? @oli-obk (rust_highfive has picked a reviewer for you, use r? to override) |
cc @Mark-Simulacrum (since you commented on the issue ;) ) r? @ollie27 |
Should be show the list of stuff not allowed in the name? |
0a399e6
to
1c19913
Compare
Updated! |
} | ||
if let Some(c) = doc_alias | ||
.chars() | ||
.find(|&c| c == '"' || c == ' ' || c == '\t' || c == '\r' || c == '\n') |
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.
.find(|&c| c == '"' || c == ' ' || c == '\t' || c == '\r' || c == '\n') | |
.find(|&c| c == '"' || c.is_whitespace()) |
Just a nit. r=me with that |
1c19913
to
63bda19
Compare
@bors: r=oli-obk |
📌 Commit 63bda197a32322e577e152e42973ef9852bf75df has been approved by |
Single quotes can also be used for exact search: rust/src/librustdoc/html/static/main.js Line 1077 in a585aae
Assuming that's the reason to disallow double quotes then surely we shouldn't allow single quotes as well? If you search for an alias surrounded by quotes: https://doc.rust-lang.org/nightly/std/?search=%22reduce%22 then the alias doesn't show up in the results. Is that a bug? |
@ollie27: I wrote this code and yet I didn't remember that... Not very serious of me haha. Great catch, thanks!
It's for exact search, so if nothing is named "reduce", it won't return anything. @bors: r- |
63bda19
to
4427b2d
Compare
@bors: r=oli-obk,ollie27 |
📌 Commit 4427b2d has been approved by |
…as-schievink Rollup of 12 pull requests Successful merges: - rust-lang#76101 (Update RELEASES.md for 1.47.0) - rust-lang#76739 (resolve: prohibit anon const non-static lifetimes) - rust-lang#76811 (Doc alias name restriction) - rust-lang#77405 (Add tracking issue of iter_advance_by feature) - rust-lang#77409 (Add example for iter chain struct) - rust-lang#77415 (Better error message for `async` blocks in a const-context) - rust-lang#77423 (Add `-Zprecise-enum-drop-elaboration`) - rust-lang#77432 (Use posix_spawn on musl targets) - rust-lang#77441 (Fix AVR stack corruption bug) - rust-lang#77442 (Clean up on example doc fixes for ptr::copy) - rust-lang#77444 (Fix span for incorrect pattern field and add label) - rust-lang#77453 (Stop running macOS builds on Azure Pipelines) Failed merges: r? `@ghost`
This issue doesn't say why the restriction on whitespace characters was added, but I'd like to share why I was using whitespace characters in doc aliases. My code has a public |
Fixes #76705.