rust icon indicating copy to clipboard operation
rust copied to clipboard

`-Zthreads` causes cycle errors in previously passing code

Open matthiaskrgr opened this issue 1 year ago • 3 comments

cargo new t
cd t
cargo add ppv-lite86
RUSTFLAGS="-Zthreads=16" ~/.cargo/bin/cargo +master build
   Compiling ppv-lite86 v0.2.17
error[E0391]: cycle detected when type-checking `x86_64::sse2::<impl at /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ppv-lite86-0.2.1>
   --> /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ppv-lite86-0.2.17/src/x86_64/sse2.rs:290:9
    |
290 |         fn $name(self) -> Self {
    |         ^^^^^^^^^^^^^^^^^^^^^^
...
313 |     rotr_128!(rotate_each_word_right32, 32);
    |     --------------------------------------- in this macro invocation
    |
note: ...which requires evaluating type-level constant...
   --> /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ppv-lite86-0.2.17/src/x86_64/sse2.rs:294:21
    |
294 |                     _mm_slli_si128(self.x, 128 - $i as i32),
    |                     ^^^^^^^^^^^^^^
...
313 |     rotr_128!(rotate_each_word_right32, 32);
    |     --------------------------------------- in this macro invocation
note: ...which requires const-evaluating + checking `x86_64::sse2::<impl at /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ppv-lite86-0>
   --> /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ppv-lite86-0.2.17/src/x86_64/sse2.rs:294:21
    |
294 |                     _mm_slli_si128(self.x, 128 - $i as i32),
    |                     ^^^^^^^^^^^^^^
...
313 |     rotr_128!(rotate_each_word_right32, 32);
    |     --------------------------------------- in this macro invocation
note: ...which requires caching mir of `x86_64::sse2::<impl at /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ppv-lite86-0.2.17/src/x86>
   --> /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ppv-lite86-0.2.17/src/x86_64/sse2.rs:294:21
    |
294 |                     _mm_slli_si128(self.x, 128 - $i as i32),
    |                     ^^^^^^^^^^^^^^
...
313 |     rotr_128!(rotate_each_word_right32, 32);
    |     --------------------------------------- in this macro invocation
note: ...which requires elaborating drops for `x86_64::sse2::<impl at /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ppv-lite86-0.2.17/>
   --> /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ppv-lite86-0.2.17/src/x86_64/sse2.rs:294:21
    |
294 |                     _mm_slli_si128(self.x, 128 - $i as i32),
    |                     ^^^^^^^^^^^^^^
...
313 |     rotr_128!(rotate_each_word_right32, 32);
...
...
...
...
```

matthiaskrgr avatar Mar 12 '24 20:03 matthiaskrgr

this bisects to #122140 cc @oli-obk

matthiaskrgr avatar Mar 12 '24 20:03 matthiaskrgr

fun fact: this breaks the the bootstrap of parallel compiler with -Zthreads since ppv-lite86 is one of the dependencies lol

matthiaskrgr avatar Mar 12 '24 20:03 matthiaskrgr

this bisects to #122140 cc @oli-obk

It’s being reverted in https://github.com/rust-lang/rust/pull/122347 — still something to fix when/if it relands of course, but at least the parallel WG won’t need to look at this issue until then.

lqd avatar Mar 12 '24 20:03 lqd