-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Reexported intrinsics show up in rustdoc intra-doc links instead of their proper paths #131676
Comments
Possibly related: intra-doc links to |
Ouch, yes we should not push more people towards these accidentally-stable names. rustdoc should treat Cc @rust-lang/rustdoc |
I wonder if we should just move the intrinsic defs to their reexport site and then reexport them from |
If #135003 lands, we will start emitting a deprecation lint for |
…h-unstable-modules-is-a-deprecation-flag, r=GuillaumeGomez rustdoc: treat `allowed_through_unstable_modules` as deprecation This ensures `std::intrinsics::transmute` is deemphasized in the search engine and other UI, by cleaning it into a deprecation without propagating it through reexports when the parent module is stable. Fixes rust-lang#131676 Related to rust-lang#135003 r? `@GuillaumeGomez` `@RalfJung` `@workingjubilee`
Rollup merge of rust-lang#135043 - notriddle:notriddle/allowed-through-unstable-modules-is-a-deprecation-flag, r=GuillaumeGomez rustdoc: treat `allowed_through_unstable_modules` as deprecation This ensures `std::intrinsics::transmute` is deemphasized in the search engine and other UI, by cleaning it into a deprecation without propagating it through reexports when the parent module is stable. Fixes rust-lang#131676 Related to rust-lang#135003 r? ``@GuillaumeGomez`` ``@RalfJung`` ``@workingjubilee``
Intra-doc links still link to the wrong place. For example, the link at https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.from_raw points to the transmute intrinsic. |
Hm yeah that is confusing -- it points to https://doc.rust-lang.org/nightly/std/intrinsics/fn.transmute.html which looks as if |
Note that the doc comment explicitly uses the For private items that are re-exported publicly, rustdoc must have some logic that prints the public path rather than the private one. Could we make rustdoc consider the unstable path "private" and hence pretend it does not exist, therefore insisting on the proper stable path everywhere? |
…-better, r=GuillaumeGomez rustdoc: use stable paths as preferred canonical paths This accomplishes something like 16a4ad7, but with the `rustc_allowed_through_unstable_modules` attribute instead of the path length. Fixes rust-lang#131676
Rollup merge of rust-lang#135171 - notriddle:notriddle/stable-path-is-better, r=GuillaumeGomez rustdoc: use stable paths as preferred canonical paths This accomplishes something like 16a4ad7, but with the `rustc_allowed_through_unstable_modules` attribute instead of the path length. Fixes rust-lang#131676
The following functions appear to be intrinsics that are re-exported at a different path (see also: #113387):
intrinsics::transmute
->mem::transmute
intrinsics::copy
->ptr::copy
intrinsics::copy_nonoverlapping
->ptr::copy_nonoverlapping
intrinsics::write_bytes
->ptr::write_bytes
Searching for these only finds the functions in
std::intrinsics
. (And for specifically transmute, it also showscore::mem::transmute
for some reason.) The search result should ideally show the functions instd::mem/ptr
. See below screenshots obtained by searching for transmute and searching for copy_nonoverlappingThe text was updated successfully, but these errors were encountered: