Skip to content

fix broken intra doc links #1767

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

Merged
merged 2 commits into from
Apr 11, 2025

Conversation

bend-n
Copy link
Contributor

@bend-n bend-n commented Apr 10, 2025

there appears to have been some broken doc links here, which are inhibiting my stdarch update
this pr fixes those broken doc links.

@rustbot
Copy link
Collaborator

rustbot commented Apr 10, 2025

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@@ -264,8 +264,8 @@ pub fn _mm512_setzero_ph() -> __m512h {

/// Return vector of type `__m128h` with indetermination elements.
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
/// In practice, this is typically equivalent to [`mem::zeroed`].
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`](core::mem::MaybeUninit).
Copy link
Member

Choose a reason for hiding this comment

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

Since core_arch is directly included in core, I don't think this will work. Wouldn't the correct link be crate::mem::MaybeUninit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

im not sure that works... i guess the safest way to do it is to directly link to https://doc.rust-lang.org/std/mem/union.MaybeUninit.html ?

Copy link
Member

Choose a reason for hiding this comment

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

Have you checked that using core::mem::MaybeUninit actually builds correctly in rust-lang/rust and passes tests? If so then it's probably fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i dont actually know as i cant figure out how to reproduce the CI failure locally.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can probably repro it locally by running ./x doc. This will build the docs, and should repro the failure (if you have x86 system, then it should definitely work, otherwise you might need to add and specify a x86 target, as these doc problems are in x86)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, i thought as much, but it wasnt reproducing the failure

Copy link
Contributor

Choose a reason for hiding this comment

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

weird! it repros in my x86 machine. But anyway, I tried with crate::mem, and it worked. The rustc repo always uses crate for core, because that enables use of the latest features (while compiling rustc, core is the previous stage compiler)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ill take your word for it

@bend-n bend-n force-pushed the rustdoc᠄᠄broken_intra_doc_links branch from 545d80e to a042adc Compare April 10, 2025 16:16
@sayantn
Copy link
Contributor

sayantn commented Apr 10, 2025

I think instead of adding specific lints to lib.rs, we should add -D warnings to ci/dox.sh, otherwise things like this will continue to happen as rustdoc gets more and more lints

@@ -277,8 +277,8 @@ pub fn _mm_undefined_ph() -> __m128h {

/// Return vector of type `__m256h` with indetermination elements.
/// Despite using the word "undefined" (following Intel's naming scheme), this non-deterministically
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`].
/// In practice, this is typically equivalent to [`mem::zeroed`].
/// picks some valid value and is not equivalent to [`mem::MaybeUninit`](crate::mem::::MaybeUninit).
Copy link
Member

Choose a reason for hiding this comment

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

You seem to have added too many :: here.

@bend-n bend-n force-pushed the rustdoc᠄᠄broken_intra_doc_links branch 2 times, most recently from 304e6a8 to 4eb734c Compare April 11, 2025 03:20
@sayantn
Copy link
Contributor

sayantn commented Apr 11, 2025

You have to add -- -D warnings to ci/dox.sh (note the initial --)

@bend-n
Copy link
Contributor Author

bend-n commented Apr 11, 2025

i tried that with just cargo doc and it didnt seem to work locally?

or on ci, for that matter

@bend-n bend-n force-pushed the rustdoc᠄᠄broken_intra_doc_links branch from ec3ebc1 to 4eb734c Compare April 11, 2025 04:43
@sayantn
Copy link
Contributor

sayantn commented Apr 11, 2025

Ok finally figured it out, RUSTDOCFLAGS=-D warnings environment variable is needed to pass arguments to rustdoc through cargo

@bend-n bend-n force-pushed the rustdoc᠄᠄broken_intra_doc_links branch from d02b942 to 4a54bbc Compare April 11, 2025 05:22
@Amanieu Amanieu added this pull request to the merge queue Apr 11, 2025
Merged via the queue into rust-lang:master with commit 9091454 Apr 11, 2025
60 checks passed
@bend-n bend-n deleted the rustdoc᠄᠄broken_intra_doc_links branch April 17, 2025 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants