doc(alias)
: should it be a mapping rather than search terms?
#82000
Labels
A-doc-alias
Area: `#[doc(alias)]`
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
needs-rfc
This change is large or controversial enough that it should have an RFC accepted before doing it.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
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:
HashMap
from Java.NULL
(for C) andnull
(for, say, JavaScript).bool
and_Bool
already pulls upbool
.P.S. this may need to be moved to internals or written as an RFC.
The text was updated successfully, but these errors were encountered: