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

Move to intra-doc links for /library/core/src/intrinsics.rs #75705

Merged
merged 17 commits into from
Aug 22, 2020

Conversation

denisvasilik
Copy link
Contributor

Helps with #75080.

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

Known issues:

  • The following f32 and f64 primitive methods cannot be resolved:

    f32/f64::powi
    f32/f64::sqrt
    f32/f64::sin
    f32/f64::cos
    f32/f64::powf
    f32/f64::exp
    f32/f64::exp2
    f32/f64::ln
    f32/f64::log2
    f32/f64::log10
    f32/f64::mul_add
    f32/f64::abs
    f32/f64::copysign
    f32/f64::floor
    f32/f64::ceil
    f32/f64::trunc
    f32/f64::round

  • Links from core to std:

    [std::pointer::*]
    [std::process::abort]
    [from_raw_parts]
    [Vec::append]

  • Links with anchors?

    I provided a separate commit that replaced links with anchors by intra-doc links.
    Here the anchor location information gets lost, so its questionable whether to
    actually replace those links.

@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 T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 19, 2020
@rust-highfive
Copy link
Collaborator

r? @LukasKalbertodt

(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 Aug 19, 2020
@jyn514
Copy link
Member

jyn514 commented Aug 19, 2020

Here the anchor location information gets lost, so its questionable whether to
actually replace those links.

You can add the anchors to the end of the intra-doc links and they'll still resolve.

@jyn514
Copy link
Member

jyn514 commented Aug 19, 2020

The following f32 and f64 primitive methods cannot be resolved

That seems weird ... f32 itself resolves fine. Might be related to #75649.

@jyn514
Copy link
Member

jyn514 commented Aug 19, 2020

Don't have time to review this fully so will defer to @LukasKalbertodt, but from the description you wrote this seems fine after you fix the anchor links.

@jyn514
Copy link
Member

jyn514 commented Aug 20, 2020

r? @jyn514

I found the time 😆

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

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

It would also be nice to change `crate::sync::atomic` to a link: [crate::sync::atomic].

library/core/src/intrinsics.rs Outdated Show resolved Hide resolved
@@ -280,23 +280,23 @@ extern "rust-intrinsic" {
/// `std::sync::atomic` types via the `load` method by passing
/// [`Ordering::SeqCst`](crate::sync::atomic::Ordering::SeqCst)
/// as the `order`. For example,
/// [`AtomicBool::load`](../../std/sync/atomic/struct.AtomicBool.html#method.load).
/// [`AtomicBool::load`](crate::sync::atomic::AtomicBool::load).
Copy link
Member

Choose a reason for hiding this comment

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

Same comment about use crate::sync::atomic::AtomicBool;.

library/core/src/intrinsics.rs Outdated Show resolved Hide resolved
@@ -619,39 +619,39 @@ extern "rust-intrinsic" {
/// `std::sync::atomic` signed integer types via the `fetch_max` method by passing
/// [`Ordering::SeqCst`](crate::sync::atomic::Ordering::SeqCst)
/// as the `order`. For example,
/// [`AtomicI32::fetch_max`](../../std/sync/atomic/struct.AtomicI32.html#method.fetch_max).
/// [`AtomicI32::fetch_max`](crate::sync::atomic::AtomicI32::fetch_max).
Copy link
Member

Choose a reason for hiding this comment

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

Same comment about use crate::sync::atomic::AtomicI32;

library/core/src/intrinsics.rs Outdated Show resolved Hide resolved
library/core/src/intrinsics.rs Outdated Show resolved Hide resolved
library/core/src/intrinsics.rs Outdated Show resolved Hide resolved
library/core/src/intrinsics.rs Outdated Show resolved Hide resolved
library/core/src/intrinsics.rs Outdated Show resolved Hide resolved
@denisvasilik
Copy link
Contributor Author

Pretty good suggestions, this cleans up the file a bit. I will integrate the changes and come up with another commit. Thanks.

library/core/src/intrinsics.rs Outdated Show resolved Hide resolved
library/core/src/intrinsics.rs Outdated Show resolved Hide resolved
@jyn514
Copy link
Member

jyn514 commented Aug 21, 2020

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 21, 2020

📌 Commit 37b6c24 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 Aug 21, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 22, 2020
Rollup of 12 pull requests

Successful merges:

 - rust-lang#75705 (Move to intra-doc links for /library/core/src/intrinsics.rs)
 - rust-lang#75711 (Split `astconv.rs` into its own submodule)
 - rust-lang#75718 (Don't count variants/fields/consts/associated types in doc-coverage doc examples)
 - rust-lang#75725 (Use intra-doc-links in `alloc`)
 - rust-lang#75745 (Remove duplication in `fold_item`)
 - rust-lang#75753 (Another motivation for CFG: return-oriented programming)
 - rust-lang#75769 (Minor, remove double nesting of a test module)
 - rust-lang#75771 (Extend normalization in const-eval-query-stack test)
 - rust-lang#75781 (More inline asm register name fixups for LLVM)
 - rust-lang#75782 (Convert core/src/str/pattern.rs to Intra-doc links)
 - rust-lang#75787 (Use intra-doc-links in `core::ops::*`)
 - rust-lang#75788 (MIR call terminator represents diverging calls too)

Failed merges:

 - rust-lang#75773 (Introduce expect snapshot testing library into rustc)

r? @ghost
@bors bors merged commit 8af33ad into rust-lang:master Aug 22, 2020
@jyn514 jyn514 removed the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Aug 25, 2020
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
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.

7 participants