Skip to content

yansi Fails to Compile Using cargo #433

@kaftw

Description

@kaftw

Hello,
I was trying to create a new project using Rocket and can't build. I get the following errors with version 0.3.2 of the rocket crate on Windows 10 when cargo attempts to compile the yansi crate.

   Compiling state v0.3.1
   Compiling yansi v0.3.3
   Compiling rayon-core v1.2.1
   Compiling idna v0.1.4
   Compiling kernel32-sys v0.2.2
error: `<std::cell::UnsafeCell<T>>::new` is not yet stable as a const fn
  --> %USERPROFILE%\.cargo\registry\src\github.com-1ecc6299db9ec823\state-0.3.1\src\container.rs:97:18
   |
97 |             map: UnsafeCell::new(0 as *mut _),
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: in Nightly builds, add `#![feature(const_unsafe_cell_new)]` to the crate attributes to enable

error: `std::sync::atomic::AtomicUsize::new` is not yet stable as a const fn
  --> %USERPROFILE%\.cargo\registry\src\github.com-1ecc6299db9ec823\state-0.3.1\src\container.rs:98:20
   |
98 |             mutex: AtomicUsize::new(0)
   |                    ^^^^^^^^^^^^^^^^^^^
   |
   = help: in Nightly builds, add `#![feature(const_atomic_usize_new)]` to the crate attributes to enable

error: `<std::cell::UnsafeCell<T>>::new` is not yet stable as a const fn
  --> %USERPROFILE%\.cargo\registry\src\github.com-1ecc6299db9ec823\state-0.3.1\src\storage.rs:72:19
   |
72 |             item: UnsafeCell::new(0 as *mut T),
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: in Nightly builds, add `#![feature(const_unsafe_cell_new)]` to the crate attributes to enable

error: `std::sync::atomic::AtomicBool::new` is not yet stable as a const fn
  --> %USERPROFILE%\.cargo\registry\src\github.com-1ecc6299db9ec823\state-0.3.1\src\init.rs:11:27
   |
11 |             init_started: AtomicBool::new(false),
   |                           ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: in Nightly builds, add `#![feature(const_atomic_bool_new)]` to the crate attributes to enable

error: `std::sync::atomic::AtomicBool::new` is not yet stable as a const fn
  --> %USERPROFILE%\.cargo\registry\src\github.com-1ecc6299db9ec823\state-0.3.1\src\init.rs:12:24
   |
12 |             init_done: AtomicBool::new(false)
   |                        ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: in Nightly builds, add `#![feature(const_atomic_bool_new)]` to the crate attributes to enable

error: aborting due to 5 previous errors

error: Could not compile `state`.
warning: build failed, waiting for other jobs to finish...
error: `std::sync::atomic::AtomicBool::new` is not yet stable as a const fn
   --> %USERPROFILE%\.cargo\registry\src\github.com-1ecc6299db9ec823\yansi-0.3.3\src\lib.rs:479:57
    |
479 | #[cfg(feature="nightly")] static DISABLED: AtomicBool = AtomicBool::new(false);
    |                                                         ^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: in Nightly builds, add `#![feature(const_atomic_bool_new)]` to the crate attributes to enable

error: aborting due to previous error

error: Could not compile `yansi`.
warning: build failed, waiting for other jobs to finish...
error: build failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstreamAn unresolvable issue: an upstream dependency bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions