-
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
Add array search aliases #80159
Add array search aliases #80159
Conversation
@@ -478,8 +478,10 @@ mod prim_unit {} | |||
#[stable(feature = "rust1", since = "1.0.0")] | |||
mod prim_pointer {} | |||
|
|||
#[doc(alias = "[;]")] | |||
#[doc(alias = "[T;N]")] // unfortunately, rustdoc doesn't have fuzzy search for aliases | |||
#[doc(alias = "[T; 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.
I'm not sure those aliases will be super useful... Maybe []
?
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.
@GuillaumeGomez []
is already used for slices: https://doc.rust-lang.org/std/?search=%5B%5D. Is it possible to have two different types with the same alias?
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.
Yup you can. :)
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.
Ok, I changed [;]
to []
. I still think [T; N]
is useful because it's used in the documentation a lot.
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.
Maybe keep [;]
too then? XD
@bors r+ rollup |
📌 Commit f2743a5 has been approved by |
Add array search aliases Missed this in rust-lang#80068. This one will really fix rust-lang#46075. The last alias especially I'm a little unsure about - maybe fuzzy search should be fixed in rustdoc instead? Happy to make that change although I'd have to figure out how. r? `@m-ou-se` although cc `@GuillaumeGomez` for the search issue.
Rollup of 11 pull requests Successful merges: - rust-lang#80159 (Add array search aliases) - rust-lang#80166 (Edit rustc_middle docs) - rust-lang#80170 (Fix ICE when lookup method in trait for type that have bound vars) - rust-lang#80171 (Edit rustc_middle::ty::TyKind docs) - rust-lang#80199 (also const-check FakeRead) - rust-lang#80211 (Handle desugaring in impl trait bound suggestion) - rust-lang#80236 (Use pointer type in AtomicPtr::swap implementation) - rust-lang#80239 (Update Clippy) - rust-lang#80240 (make sure installer only creates directories in DESTDIR) - rust-lang#80244 (Cleanup markdown span handling) - rust-lang#80250 (Minor cleanups in LateResolver) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Missed this in #80068. This one will really fix #46075.
The last alias especially I'm a little unsure about - maybe fuzzy search should be fixed in rustdoc instead? Happy to make that change although I'd have to figure out how.
r? @m-ou-se although cc @GuillaumeGomez for the search issue.