Skip to content

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

Merged
bors merged 17 commits into
rust-lang:masterfrom
denisvasilik:intra-doc-links-intrinsics
Aug 22, 2020
Merged

Move to intra-doc links for /library/core/src/intrinsics.rs#75705
bors merged 17 commits into
rust-lang:masterfrom
denisvasilik:intra-doc-links-intrinsics

Conversation

@denisvasilik

Copy link
Copy Markdown
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.

@rustbotrustbot 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
Copy Markdown
Contributor

r? @LukasKalbertodt

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 19, 2020
@jyn514

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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
Copy Markdown
Member

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
Copy Markdown
Member

r? @jyn514

I found the time 😆

@jyn514jyn514 left a comment

Copy link
Copy Markdown
Member

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].

Comment threadlibrary/core/src/intrinsics.rs Outdated
Comment threadlibrary/core/src/intrinsics.rs Outdated
/// [`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
Copy Markdown
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;.

Comment threadlibrary/core/src/intrinsics.rs Outdated
Comment threadlibrary/core/src/intrinsics.rs Outdated
/// [`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
Copy Markdown
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;

Comment threadlibrary/core/src/intrinsics.rs Outdated
Comment threadlibrary/core/src/intrinsics.rs Outdated
Comment threadlibrary/core/src/intrinsics.rs Outdated
Comment threadlibrary/core/src/intrinsics.rs Outdated
Comment threadlibrary/core/src/intrinsics.rs Outdated
@denisvasilik

Copy link
Copy Markdown
ContributorAuthor

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

Comment threadlibrary/core/src/intrinsics.rs Outdated
Comment threadlibrary/core/src/intrinsics.rs Outdated
@jyn514

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Aug 21, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 37b6c24 has been approved by jyn514

@borsbors 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:masterAug 22, 2020
@jyn514jyn514 removed the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Aug 25, 2020
@cuvipercuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameS-waiting-on-borsStatus: 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

@denisvasilik@rust-highfive@jyn514@bors@cuviper@LukasKalbertodt@rustbot