Skip to content

Commit cff979e

Browse files
authored
Validate generating docs (rust-lang/portable-simd#407)
- Generate docs with warnings disabled. - Instruct doctest to add `#![deny(warnings)]` to all tests.
1 parent 53de3f0 commit cff979e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ jobs:
141141
- name: Test (release)
142142
run: cargo test --verbose --target=${{ matrix.target }} --release
143143

144+
- name: Generate docs
145+
run: cargo doc --verbose --target=${{ matrix.target }}
146+
env:
147+
RUSTDOCFLAGS: -Dwarnings
148+
144149
wasm-tests:
145150
name: "wasm (firefox, ${{ matrix.name }})"
146151
runs-on: ubuntu-latest

crates/core_simd/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
)]
4141
#![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
4242
#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
43+
#![doc(test(attr(deny(warnings))))]
4344
#![allow(internal_features)]
4445
#![unstable(feature = "portable_simd", issue = "86656")]
4546
//! Portable SIMD module.

crates/core_simd/src/vector.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ where
325325
/// # #![feature(portable_simd)]
326326
/// # #[cfg(feature = "as_crate")] use core_simd::simd;
327327
/// # #[cfg(not(feature = "as_crate"))] use core::simd;
328-
/// # use simd::{Simd, Mask};
328+
/// # use simd::Simd;
329329
/// let vec: Vec<i32> = vec![10, 11];
330330
///
331331
/// let result = Simd::<i32, 4>::load_or_default(&vec);
@@ -348,7 +348,7 @@ where
348348
/// # #![feature(portable_simd)]
349349
/// # #[cfg(feature = "as_crate")] use core_simd::simd;
350350
/// # #[cfg(not(feature = "as_crate"))] use core::simd;
351-
/// # use simd::{Simd, Mask};
351+
/// # use simd::Simd;
352352
/// let vec: Vec<i32> = vec![10, 11];
353353
/// let or = Simd::from_array([-5, -4, -3, -2]);
354354
///
@@ -695,7 +695,7 @@ where
695695
///
696696
/// # Safety
697697
///
698-
/// Memory addresses for element are calculated [`core::ptr::wrapping_offset`] and
698+
/// Memory addresses for element are calculated [`pointer::wrapping_offset`] and
699699
/// each enabled element must satisfy the same conditions as [`core::ptr::write`].
700700
#[inline]
701701
pub unsafe fn store_select_ptr(self, ptr: *mut T, enable: Mask<<T as SimdElement>::Mask, N>) {

0 commit comments

Comments
 (0)