-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Clean up doc_alias feature #76705
Comments
Actually, the |
That doesn't work for
It would make sense to restrict allowed characters because even whitespace is allowed at the moment which seems questionable. |
It sounds like we need to make sure this lands before we branch beta or so? |
Let's forbid |
Can we avoid ad-hoc rules and say something like "must be a rust identifier"? |
Even better! Great suggestion @Mark-Simulacrum ! |
Just thought about it, but it cannot be the case @Mark-Simulacrum : we allow things like "*" or "+" (for the traits for example), so it cannot be ident only. I'll stick to the listed characters above. |
The documentation (https://doc.rust-lang.org/nightly/rustdoc/advanced-features.html?highlight=alias#add-aliases-for-an-item-in-documentation-search) has no mention of that -- can you elaborate? |
Doc aliases can be something else than a rust identifier. For example, you can look for |
Ah, I see what you mean. Okay, then I agree that we need more than just Rust identifiers, and it might be reasonable to just allow as you suggest -- everything except whitespace and quotes. I'm a bit worried that'll hurt us in terms of how expansive it is but it's probably fine. |
I don't expect |
Is there more justification for removing whitespace support other than calling the characters questionable? If I have a struct or a function that implements an algorithm, I would like to alias the item to the plaintext name of the algorithm, for example |
I just had in mind "idents", so no whitespace in them. However I don't see any reason to not allow |
rustdoc only being ident-centric is something that I wish would be improved.
|
path-centric would be more accurate. ;) |
…, r=jyn514,ollie27 Allow ascii whitespace char for doc aliases Fixes issue from rust-lang#76705 (comment) cc @lopopolo @ollie27 r? @jyn514
From this comment: #50146 (comment)
Still remaining the
.replace()
.The text was updated successfully, but these errors were encountered: