-
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
Tweak std::marker docs #36424
Tweak std::marker docs #36424
Conversation
@@ -60,13 +76,16 @@ pub trait Sized { | |||
} | |||
|
|||
/// Types that can be "unsized" to a dynamically sized type. | |||
/// | |||
/// For example, the sized array type `[i8; 2]` implements `Unsize<[u8]>` and |
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.
It might be worth briefly talking about how Unsize
is paired with CoerceUnsized
and what it's used for here.
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.
Yeah, that's something I don't understand particularly well. Do you have a reference?
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 think the RFC should still mostly reflect the current reality but I'm not super familiar with DST coercions either: /~https://github.com/nrc/rfcs/blob/4b99006cac67f7ad89c670bcb351d32bc0d5d33f/text/0000-dst-coercion.md
|
/// [rwlock]: ../../std/sync/struct.RwLock.html | ||
/// [unsafecell]: ../cell/struct.UnsafeCell.html | ||
/// [ub]: ../../reference.html#behavior-considered-undefined | ||
/// [transmute]: ../mem/fn.transmute.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.
core::mem::transmute
doesn't exist, which might make this problematic?
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.
Add "../std".
Addressed review comments. Thanks everyone. |
Please squash your commits! Once done, I'd prefer to wait that #36363 has been merged before r+ yours to avoid conflicts. |
Yeah, that's going to conflict. I'll fix my PR once it lands. |
95d33a8
to
8c03346
Compare
☔ The latest upstream changes (presumably #36472) made this pull request unmergeable. Please resolve the merge conflicts. |
58fafb7
to
81d3f6a
Compare
I resolved conflicts and rebased. |
/// [typeid]: ../any/struct.TypeId.html | ||
/// [param]: http://en.wikipedia.org/wiki/Parametricity | ||
/// [size_of]: ../mem/fn.size_of.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.
This line is useless.
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.
Fixed.
/// | ||
/// If your struct does not in fact *own* the data of type `T`, it is | ||
/// better to use a reference type, like `PhantomData<&'a T>` | ||
/// (ideally) or `PhantomData<*const T>` (if no lifetime applies), so | ||
/// as not to indicate ownership. | ||
/// | ||
/// [drop check]: ../../nomicon/dropck.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.
This line is useless.
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 saw that some of the existing docs have it. I think it makes things more readable in the source code. If you feel very strongly I'll remove it, though.
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.
Fixed.
81d3f6a
to
b735c1b
Compare
Thanks! @bors: r+ rollup |
📌 Commit b735c1b has been approved by |
…r-docs, r=GuillaumeGomez Tweak std::marker docs Fixes rust-lang#29361. r? @GuillaumeGomez
…r-docs, r=GuillaumeGomez Tweak std::marker docs Fixes rust-lang#29361. r? @GuillaumeGomez
Fixes #29361.
r? @GuillaumeGomez