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

Fail to build rustfmt since rustc 1.40.0-nightly (c27f7568b 2019-10-13) #65424

Closed
topecongiro opened this issue Oct 15, 2019 · 3 comments · Fixed by crossbeam-rs/crossbeam#428

Comments

@topecongiro
Copy link
Contributor

topecongiro commented Oct 15, 2019

git clone https://github.com/rust-lang/rustfmt
cd rustfmt
cargo b

Running the above commands will fail with the following error when using rustc 1.40.0-nightly (e413dc36a 2019-10-14) in Linux, macOS and Windows:

   Compiling crossbeam-channel v0.3.9
error[E0432]: unresolved import `crossbeam_utils::atomic`
 --> /Users/seiichi.uchida/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/crossbeam-channel-0.3.9/src/flavors/tick.rs:8:22
  |
8 | use crossbeam_utils::atomic::AtomicCell;
  |                      ^^^^^^ could not find `atomic` in `crossbeam_utils`

I have tested with multiple recent nightlies. It turns out that the build started to fail since rustc 1.40.0-nightly (c27f7568b 2019-10-13). Building with rustc 1.40.0-nightly (1721c9685 2019-10-12) or earlier succeeded without any error.

@topecongiro topecongiro changed the title Fail to build rustfmt since Fail to build rustfmt since rustc 1.40.0-nightly (c27f7568b 2019-10-13) Oct 15, 2019
@sinkuu
Copy link
Contributor

sinkuu commented Oct 15, 2019

crossbeam_utils::atomic module is gated under cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr")).

https://github.com/crossbeam-rs/crossbeam/blob/ae148dec8eff2ee40dc4d6c11ae63d79bfd79b6e/crossbeam-utils/src/lib.rs#L47-L51

This module got disabled because the value of cfg!(target_has_atomic) was changed between two nightlies:

/t/bar (master|…) $ cargo +nightly-2019-10-13 run
   Compiling bar v0.1.0 (/tmp/bar)
    Finished dev [unoptimized + debuginfo] target(s) in 0.38s
     Running `target/debug/bar`
[src/main.rs:3] cfg!(target_has_atomic = "cas") = true
[src/main.rs:4] cfg!(target_has_atomic = "ptr") = true

/t/bar (master|…) $ cargo +nightly-2019-10-14 run
   Compiling bar v0.1.0 (/tmp/bar)
    Finished dev [unoptimized + debuginfo] target(s) in 0.36s
     Running `target/debug/bar`
[src/main.rs:3] cfg!(target_has_atomic = "cas") = false
[src/main.rs:4] cfg!(target_has_atomic = "ptr") = true

@sinkuu
Copy link
Contributor

sinkuu commented Oct 15, 2019

target_has_atomic = "cas" was removed by #65214 (cfg_target_has_atomic is a nightly feature), so this is an expected breakage. crossbeam-utils crate has to be fixed.

@topecongiro
Copy link
Contributor Author

@sinkuu Thank you for all the information! I will close this as it is an expected breakage.

bors bot added a commit to crossbeam-rs/crossbeam that referenced this issue Oct 15, 2019
428: Fix breakage with nightly feature r=jeehoonkang a=taiki-e

`target_has_atomic = "cas"` was removed in rust-lang/rust#65214.

Fixes rust-lang/rust#65424 



Co-authored-by: Taiki Endo <te316e89@gmail.com>
bors bot added a commit to crossbeam-rs/crossbeam that referenced this issue Oct 15, 2019
428: Fix breakage with nightly feature r=jeehoonkang a=taiki-e

`target_has_atomic = "cas"` was removed in rust-lang/rust#65214.

Fixes rust-lang/rust#65424 
Fixes #412


Co-authored-by: Taiki Endo <te316e89@gmail.com>
bors bot added a commit to crossbeam-rs/crossbeam that referenced this issue Oct 16, 2019
428: Fix build failure on nightly and the minimum version r=jeehoonkang a=taiki-e

`target_has_atomic = "cas"` was removed in rust-lang/rust#65214.

Fixes rust-lang/rust#65424 
Fixes #412


Co-authored-by: Taiki Endo <te316e89@gmail.com>
bors bot added a commit to crossbeam-rs/crossbeam that referenced this issue Oct 16, 2019
428: Fix build failure on nightly and the minimum version r=jeehoonkang a=taiki-e

`target_has_atomic = "cas"` was removed in rust-lang/rust#65214.

Fixes rust-lang/rust#65424 
Fixes #412


Co-authored-by: Taiki Endo <te316e89@gmail.com>
kornstar11 added a commit to protectwise/pcap-async that referenced this issue Dec 10, 2019
kornstar11 added a commit to protectwise/pcap-async that referenced this issue Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants