Skip to content
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 core::marker #76261

Merged
merged 2 commits into from
Sep 3, 2020

Conversation

camelid
Copy link
Member

@camelid camelid commented Sep 2, 2020

Part of #75080.

Also cleaned up a few things.


@rustbot modify labels: A-intra-doc-links T-doc

@rustbot rustbot added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels Sep 2, 2020
@rust-highfive
Copy link
Collaborator

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 2, 2020
@camelid
Copy link
Member Author

camelid commented Sep 2, 2020

This whole size_of::<T> thing looks a bit confusing to me. I don't fully understand it myself, but maybe in the future it could be clarified/expanded on a bit?

/// Generalizing the latter case, any type implementing [`Drop`] can't be `Copy`, because it's
/// managing some resource besides its own [`size_of::<T>`] bytes.

@@ -764,9 +757,9 @@ unsafe impl<T: ?Sized> Freeze for &mut T {}
///
/// This trait is automatically implemented for almost every type.
///
/// [`mem::replace`]: ../../std/mem/fn.replace.html
/// [`mem::replace`]: crate::mem::replace
/// [Pin]: crate::pin::Pin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a few things were converted to intra-doc before!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank matklad :) #75780

@jyn514
Copy link
Member

jyn514 commented Sep 2, 2020

Generalizing the latter case, any type implementing [Drop] can't be Copy, because it's managing some resource besides its own [size_of::<T>] bytes.

Yeah this is a confusing way to word it. I think it's trying to say that it owns something the compiler doesn't know about, like a file descriptor or a pointer, as to opposed to types without a custom Drop that you can destructure.

library/core/src/marker.rs Outdated Show resolved Hide resolved
@@ -764,9 +757,9 @@ unsafe impl<T: ?Sized> Freeze for &mut T {}
///
/// This trait is automatically implemented for almost every type.
///
/// [`mem::replace`]: ../../std/mem/fn.replace.html
/// [`mem::replace`]: crate::mem::replace
/// [Pin]: crate::pin::Pin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank matklad :) #75780

@jyn514
Copy link
Member

jyn514 commented Sep 2, 2020

r=me once CI passes

@Dylan-DPC-zz
Copy link

r? @jyn514

@rust-highfive rust-highfive assigned jyn514 and unassigned cramertj Sep 2, 2020
@jyn514
Copy link
Member

jyn514 commented Sep 2, 2020

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 2, 2020

📌 Commit 7926435 has been approved by jyn514

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 2, 2020
@camelid
Copy link
Member Author

camelid commented Sep 2, 2020

Hmm, bors is sleepy.

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 3, 2020
Rollup of 12 pull requests

Successful merges:

 - rust-lang#75150 (Add a note for Ipv4Addr::to_ipv6_compatible)
 - rust-lang#76120 (Add `[T; N]::as_[mut_]slice`)
 - rust-lang#76142 (Make all methods of `std::net::Ipv4Addr` const)
 - rust-lang#76164 (Link to slice pattern in array docs)
 - rust-lang#76167 (Replace MinGW library hack with heuristic controlling link mode)
 - rust-lang#76204 (Rename and expose LoopState as ControlFlow)
 - rust-lang#76238 (Move to intra-doc links for library/core/src/iter/traits/iterator.rs)
 - rust-lang#76242 (Read: adjust a FIXME reference)
 - rust-lang#76243 (Fix typos in vec try_reserve(_exact) docs)
 - rust-lang#76245 (inliner: Avoid query cycles when optimizing generators)
 - rust-lang#76255 (Update books)
 - rust-lang#76261 (Use intra-doc links in `core::marker`)

Failed merges:

r? @ghost
@bors bors merged commit af331a2 into rust-lang:master Sep 3, 2020
@camelid camelid deleted the intra-doc-links-for-core-marker branch September 3, 2020 02:25
@cuviper cuviper added this to the 1.48.0 milestone Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants