-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
doc(alias): should it be a mapping rather than search terms? #82000
Copy link
Copy link
Closed
Labels
A-doc-aliasArea: `#[doc(alias)]`Area: `#[doc(alias)]`C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.needs-rfcThis change is large or controversial enough that it should have an RFC accepted before doing it.This change is large or controversial enough that it should have an RFC accepted before doing it.
Metadata
Metadata
Assignees
Labels
A-doc-aliasArea: `#[doc(alias)]`Area: `#[doc(alias)]`C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.needs-rfcThis change is large or controversial enough that it should have an RFC accepted before doing it.This change is large or controversial enough that it should have an RFC accepted before doing it.
Type
Fields
Give feedbackNo fields configured for issues without a type.
PRs such as #81988 and #81989 add aliases inspired in terms coming from other languages such as C, Python and Java.
Questions were raised about how far are we willing to go: should we really add a mapping of functions/features from other languages to Rust? Where do we stop? i.e. "how much is too much".
If the changes in those two PRs are agreed to be useful, then I think we should consider making the mapping "official" and elevate it to that, rather than just a bunch of related search terms without documentation. In other words, something like:
#[doc(alias = "sprintf", lang = "C, C++, POSIX")]This would bring a series of advantages:
The downside, of course, is that there could be a lot of this lines added and clutter the source code if many people start adding terms from many languages. One could argue that if that happens it is because the feature became very popular (and Rust too) -- so "death by success". :) One could also argue to move it out of line.
Answering this question, whether positively or negatively, also resolves other questions that were raised such as:
HashMapfrom Java.NULL(for C) andnull(for, say, JavaScript).booland_Boolalready pulls upbool.P.S. this may need to be moved to internals or written as an RFC.