-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use intra-doc links in mem::manually_drop
& mem::maybe_uninit
#75214
Conversation
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
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.
Looks good once links are fixed and CI is passing :)
@@ -56,8 +56,7 @@ use crate::ptr; | |||
/// working with [pinned] data, where reusing the memory without calling the destructor could lead | |||
/// to Undefined Behaviour. | |||
/// | |||
/// [`mem::zeroed`]: fn.zeroed.html | |||
/// [`MaybeUninit<T>`]: union.MaybeUninit.html | |||
/// [`mem::zeroed`]: MaybeUninit::<T>::zeroed |
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.
Rustdoc will not resolve this <T>
: #62834. But also I think it was meant to link to mem::zeroed
, not MaybeUnint::zeroed
, so you can leave it out altogether and it will still be resolved.
/// [`mem::zeroed`]: MaybeUninit::<T>::zeroed | |
/// [`MaybeUninit<T>`]: MaybeUninit |
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.
Thank you for your suggestion.
/// [
MaybeUninit]: MaybeUninit
shows unresolved link error
...
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 fixed it with [
MaybeUninit]: crate::mem::MaybeUninit
library/core/src/mem/maybe_uninit.rs
Outdated
@@ -64,7 +64,7 @@ use crate::mem::ManuallyDrop; | |||
/// *immediate* undefined behavior, but will cause undefined behavior with most | |||
/// safe operations (including dropping it). | |||
/// | |||
/// [`Vec<T>`]: ../../std/vec/struct.Vec.html | |||
/// [`Vec<T>`]: std::vec::Vec<T> |
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.
This is in core
and Vec
is in alloc
. So this link will not resolve: #74481.
/// [`Vec<T>`]: std::vec::Vec<T> | |
/// [`Vec<T>`]: ../../std/vec/struct.Vec.html |
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.
Thanks...I was misunderstanding. I will fix it and squash the commit
8276d39
to
288e9ba
Compare
@@ -56,8 +56,7 @@ use crate::ptr; | |||
/// working with [pinned] data, where reusing the memory without calling the destructor could lead | |||
/// to Undefined Behaviour. | |||
/// | |||
/// [`mem::zeroed`]: fn.zeroed.html | |||
/// [`MaybeUninit<T>`]: union.MaybeUninit.html | |||
/// [`MaybeUninit<T>`]: MaybeUninit | |||
/// [pinned]: ../pin/index.html |
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.
/// [pinned]: ../pin/index.html | |
/// [pinned]: crate::pin |
/// [`ManuallyDrop::into_inner`]: #method.into_inner | ||
/// [`ptr::drop_in_place`]: ../ptr/fn.drop_in_place.html | ||
/// [`into_inner`]: ManuallyDrop::into_inner | ||
/// [`drop_in_place`]: ptr::drop_in_place |
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.
Is ptr
in scope in this module? If so this is fine, but otherwise it needs to be crate::ptr
or super::ptr
.
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 thought that ptr
was in scope since it doesn't give me results in unresolved link
error... but anyway I will add crate
. Thanks
288e9ba
to
a296df0
Compare
Broken links
|
072a905
to
d8536c3
Compare
/// [`drop`]: ManuallyDrop::drop | ||
/// [`into_inner`]: ManuallyDrop::into_inner |
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 don't see anything using drop
or into_inner
so you can remove these reference links :)
/// [`drop`]: ManuallyDrop::drop | |
/// [`into_inner`]: ManuallyDrop::into_inner |
/// [`into_inner`]: ManuallyDrop::into_inner | ||
/// [`drop_in_place`]: crate::ptr::drop_in_place |
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.
Same here, the links don't seem to be used.
/// [`into_inner`]: ManuallyDrop::into_inner | |
/// [`drop_in_place`]: crate::ptr::drop_in_place |
/// [`mem::zeroed`]: fn.zeroed.html | ||
/// [`MaybeUninit<T>`]: union.MaybeUninit.html | ||
/// [pinned]: ../pin/index.html | ||
/// [`mem::zeroed`]: crate::mem::MaybeUninit::zeroed |
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.
Are you sure this didn't mean to link to crate::mem::zeroed
?
/// [`mem::zeroed`]: crate::mem::MaybeUninit::zeroed | |
/// [`mem::zeroed`]: crate::mem::zeroed |
d8536c3
to
61866bc
Compare
@bors r+ rollup |
📌 Commit 61866bc has been approved by |
Rollup of 17 pull requests Successful merges: - rust-lang#73943 (Document the unsafe keyword) - rust-lang#74062 (deny(unsafe_op_in_unsafe_fn) in libstd/ffi/c_str.rs) - rust-lang#74185 (Remove liballoc unneeded explicit link) - rust-lang#74192 (Improve documentation on process::Child.std* fields) - rust-lang#74409 (Change Debug impl of SocketAddr and IpAddr to match their Display output) - rust-lang#75195 (BTreeMap: purge innocent use of into_kv_mut) - rust-lang#75214 (Use intra-doc links in `mem::manually_drop` & `mem::maybe_uninit`) - rust-lang#75432 (Switch to intra-doc links in `std::process`) - rust-lang#75482 (Clean up E0752 explanation) - rust-lang#75501 (Move to intra doc links in std::ffi) - rust-lang#75509 (Tweak suggestion for `this` -> `self`) - rust-lang#75511 (Do not emit E0228 when it is implied by E0106) - rust-lang#75515 (Bump std's libc version to 0.2.74) - rust-lang#75517 (Promotion and const interning comments) - rust-lang#75519 (BTreeMap: refactor splitpoint and move testing over to unit test) - rust-lang#75530 (Switch to intra-doc links in os/raw/*.md) - rust-lang#75531 (Migrate unit tests of btree collections to their native breeding ground) Failed merges: r? @ghost
This is partial fixes for #75080.