Skip to content

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

Closed
crossbeam-rs/crossbeam
#428
@topecongiro

Description

@topecongiro
Contributor
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/github.tiyicn.workers.dev-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.

Activity

changed the title [-]Fail to build rustfmt since [/-] [+]Fail to build rustfmt since rustc 1.40.0-nightly (c27f7568b 2019-10-13)[/+] on Oct 15, 2019
sinkuu

sinkuu commented on Oct 15, 2019

@sinkuu
Contributor

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

sinkuu commented on Oct 15, 2019

@sinkuu
Contributor

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

topecongiro commented on Oct 15, 2019

@topecongiro
ContributorAuthor

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

added 4 commits that reference this issue on Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @sinkuu@topecongiro

      Issue actions

        Fail to build rustfmt since rustc 1.40.0-nightly (c27f7568b 2019-10-13) · Issue #65424 · rust-lang/rust