Skip to content
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

x.py test fails due to "unnecessary unsafe block" in stdarch #91315

Closed
petrochenkov opened this issue Nov 28, 2021 · 3 comments
Closed

x.py test fails due to "unnecessary unsafe block" in stdarch #91315

petrochenkov opened this issue Nov 28, 2021 · 3 comments
Labels
A-SIMD Area: SIMD (Single Instruction Multiple Data) A-testsuite Area: The testsuite used to check the correctness of rustc T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

./x.py test --bless --stage 2 library/core
   Doc-tests core

running 3677 tests
.........................................i..i................iiiii.i.....F....i..................... 100/3677
.................................................................................................... 200/3677
...........................................................................................ii....... 300/3677
.................................................................................................... 400/3677
..........................................i......................................................... 500/3677
.................................................................................................... 600/3677
......................ii.................iiii....................................................... 700/3677
.................................................................................................... 800/3677
.................................................................................................... 900/3677
.................................................................................................... 1000/3677
.................................................................................................... 1100/3677
.................................................................................................... 1200/3677
.................................................................................................... 1300/3677
.................................................................................................... 1400/3677
.................................................................................................... 1500/3677
.................................................................................................... 1600/3677
.................................................................................................... 1700/3677
.................................................................................................... 1800/3677
.................................................................................................... 1900/3677
.................................................................................................... 2000/3677
.................................................................................................... 2100/3677
.................................................................................................... 2200/3677
.................................................................................................... 2300/3677
.................................................................................................... 2400/3677
.................................................................................................... 2500/3677
.................................................................................................... 2600/3677
.................................................................................................... 2700/3677
.................................................................................................... 2800/3677
.................................................................................................... 2900/3677
......................iii........................................................................... 3000/3677
.................................................................................................... 3100/3677
.................................................................................................... 3200/3677
.................................................................................................... 3300/3677
................i.................................................i................i................ 3400/3677
.....i.....................i.....................i.....................i............................ 3500/3677
....i.....................i.....................i.....................i.....................i....... 3600/3677
.............................................................................
failures:

---- src\..\..\stdarch\crates\core_arch\src\x86\sse41.rs - core_arch::x86::sse41::_mm_extract_ps (line 148) stdout ----
error: unnecessary `unsafe` block
  --> src\..\..\stdarch\crates\core_arch\src\x86\sse41.rs:158:1
   |
10 |       unsafe fn worker() {
   |       ------------------ because it's nested under this `unsafe` fn
11 | let mut float_store = vec![1.0, 1.0, 2.0, 3.0];
12 | unsafe {
   | ^^^^^^ unnecessary `unsafe` block
   |
note: the lint level is defined here
  --> src\..\..\stdarch\crates\core_arch\src\x86\sse41.rs:147:9
   |
1  | #![deny(warnings)]
   |         ^^^^^^^^
   = note: `#[deny(unused_unsafe)]` implied by `#[deny(warnings)]`

error: aborting due to previous error

Couldn't compile the test.

failures:
    src\..\..\stdarch\crates\core_arch\src\x86\sse41.rs - core_arch::x86::sse41::_mm_extract_ps (line 148)

test result: FAILED. 3643 passed; 1 failed; 33 ignored; 0 measured; 0 filtered out; finished in 269.62s

error: test failed, to rerun pass '--doc'


command did not execute successfully: "\\\\?\\C:\\msys64\\home\\we\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\bin\\cargo.exe" "test" "--target" "x86_64-pc-windows-gnu" "-Zbinary-dep-depinfo" "-j" "8" "--release" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "C:\\msys64\\home\\we\\rust\\library/test/Cargo.toml" "-p" "core" "--" "--quiet"
expected success, got: exit code: 101

My target is x86_64-pc-windows-gnu.
This passed through CI, so there perhaps some configuration mismatch?
I didn't investigate further.

@petrochenkov petrochenkov added A-SIMD Area: SIMD (Single Instruction Multiple Data) A-testsuite Area: The testsuite used to check the correctness of rustc T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 28, 2021
@ehuss
Copy link
Contributor

ehuss commented Nov 29, 2021

Do you have a configuration that sets -C target-cpu=native or something similar?

Those tests are not normally run on CI since they all use the default cpu, which in this case does not enable SSE4.1.

I have posted rust-lang/stdarch#1261 to fix the error itself.

I'm not sure if we should look into trying to get doctests to work with other CPUs on CI.

@petrochenkov
Copy link
Contributor Author

@ehuss
Thanks!
Yes, I'm using -C target-cpu=native for rustc development.

@petrochenkov
Copy link
Contributor Author

stdarch submodule was updated in #91548, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-SIMD Area: SIMD (Single Instruction Multiple Data) A-testsuite Area: The testsuite used to check the correctness of rustc T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants