Repository navigation
Closed
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.PG-portable-simdProject group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)
Description
It looks like portable-simd doctests (and possibly the other tests as well) are entirely untested in this repo. Since #146882, some of the doctests are now failing to compile:
0.000008 ---- crates/core_simd/src/simd/num/int.rs - core_simd::simd::num::int::SimdInt::abs_diff (line 81) stdout ----
0.000007 error: use of deprecated constant `std::i32::MIN`: replaced by the `MIN` associated constant on this type
0.000007 --> crates/core_simd/src/simd/num/int.rs:89:27
0.000007 |
0.000006 89 | let a = Simd::from_array([MIN, MAX, 100, -100]);
0.000007 | ^^^
0.000006 |
0.000007 note: the lint level is defined here
0.000007 --> crates/core_simd/src/simd/num/int.rs:79:9
0.000007 |
0.000007 79 | #![deny(warnings)]
0.000006 | ^^^^^^^^
0.000007 = note: `#[deny(deprecated)]` implied by `#[deny(warnings)]`
0.000007
0.000007 error: use of deprecated constant `std::i32::MAX`: replaced by the `MAX` associated constant on this type
0.000008 --> crates/core_simd/src/simd/num/int.rs:89:32
0.000005 |
0.000005 89 | let a = Simd::from_array([MIN, MAX, 100, -100]);
0.000004 | ^^^
0.000005
0.000004 error: use of deprecated constant `std::i32::MAX`: replaced by the `MAX` associated constant on this type
0.000005 --> crates/core_simd/src/simd/num/int.rs:90:27
0.000004 |
0.000005 90 | let b = Simd::from_array([MAX, MIN, -80, -120]);
0.000004 | ^^^
0.000005
0.000004 error: use of deprecated constant `std::i32::MIN`: replaced by the `MIN` associated constant on this type
0.000005 --> crates/core_simd/src/simd/num/int.rs:90:32
0.000004 |
0.000005 90 | let b = Simd::from_array([MAX, MIN, -80, -120]);
0.000004 | ^^^
0.000005
0.000005 error: use of deprecated constant `std::i32::MIN`: replaced by the `MIN` associated constant on this type
0.000004 --> crates/core_simd/src/simd/num/int.rs:88:17
0.000005 |
0.000008 88 | use core::i32::{MIN, MAX};
0.000007 | ^^^
0.000007
0.000007 error: use of deprecated constant `std::i32::MAX`: replaced by the `MAX` associated constant on this type
0.000007 --> crates/core_simd/src/simd/num/int.rs:88:22
0.000007 |
0.000007 88 | use core::i32::{MIN, MAX};
0.000007 | ^^^
0.000010
0.000008 error: aborting due to 6 previous errors
0.000012
0.000007 Couldn't compile the test.
We should have at least some basic "does it build" smoke tests running in this repo.
Cc @rust-lang/project-portable-simd
Metadata
Metadata
Assignees
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.PG-portable-simdProject group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)
Activity
RalfJung commentedon Aug 6, 2026
I am very surprised that apparently this is not run together with
./x test library/core --doc. These files are included as a regular module in libcore, aren't they?RalfJung commentedon Aug 6, 2026
@Kobzol any idea why these doctests apparently have not been run?
RalfJung commentedon Aug 6, 2026
Hm, there's also something else that is odd... the output says
int.rs:79is where we configuredeny(warnings)but there is no such thing there?rust/library/portable-simd/crates/core_simd/src/simd/num/int.rs
Lines 77 to 91 in 7608eb7
Is rustdoc sometimes auto-inserting a
deny(warnings)?RalfJung commentedon Aug 6, 2026
Ah, I think I found it... libcore has this
but portable-simd's core crate only has
#![doc(test(attr(deny(warnings))))]Therefore the tests work fine when run as part of libcore, but don't work when run separately.