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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ci/dox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

set -ex

export RUSTDOCFLAGS="-D warnings"

dox() {
if [ "$CI" != "" ]; then
rustup target add "${1}" || true
Expand Down Expand Up @@ -38,4 +40,4 @@ if [ -z "$1" ]; then
dox nvptx64-nvidia-cuda
else
dox "${1}"
fi
fi
12 changes: 6 additions & 6 deletions crates/core_arch/src/x86/avx512fp16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`](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.

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

/// In practice, this is typically equivalent to [`mem::zeroed`](crate::mem::zeroed).
///
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_undefined_ph)
#[inline]
Expand All @@ -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.

/// In practice, this is typically equivalent to [`mem::zeroed`](crate::mem::zeroed).
///
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_undefined_ph)
#[inline]
Expand All @@ -290,8 +290,8 @@ pub fn _mm256_undefined_ph() -> __m256h {

/// Return vector of type `__m512h` 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).
/// In practice, this is typically equivalent to [`mem::zeroed`](crate::mem::zeroed).
///
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_undefined_ph)
#[inline]
Expand Down