Amanieu/parking_lot

lock_api 0.4.7 fails to build in nightly

xlambein opened this issue · 2 comments

When trying to build lazy_static, which indirectly depends on lock_api, I get the following:

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
   --> /home/xlambein/.cargo/registry/src/github.com-1ecc6299db9ec823/lock_api-0.4.7/src/mutex.rs:150:6
    |
150 | impl<R: RawMutex, T> Mutex<R, T> {
    |      ^
...
154 |     pub const fn new(val: T) -> Mutex<R, T> {
    |     --------------------------------------- function declared as const here
    |
    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
   --> /home/xlambein/.cargo/registry/src/github.com-1ecc6299db9ec823/lock_api-0.4.7/src/remutex.rs:231:6
    |
231 | impl<R: RawMutex, G: GetThreadId, T> ReentrantMutex<R, G, T> {
    |      ^
...
235 |     pub const fn new(val: T) -> ReentrantMutex<R, G, T> {
    |     --------------------------------------------------- function declared as const here
    |
    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
   --> /home/xlambein/.cargo/registry/src/github.com-1ecc6299db9ec823/lock_api-0.4.7/src/remutex.rs:231:19
    |
231 | impl<R: RawMutex, G: GetThreadId, T> ReentrantMutex<R, G, T> {
    |                   ^
...
235 |     pub const fn new(val: T) -> ReentrantMutex<R, G, T> {
    |     --------------------------------------------------- function declared as const here
    |
    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
   --> /home/xlambein/.cargo/registry/src/github.com-1ecc6299db9ec823/lock_api-0.4.7/src/rwlock.rs:367:6
    |
367 | impl<R: RawRwLock, T> RwLock<R, T> {
    |      ^
...
371 |     pub const fn new(val: T) -> RwLock<R, T> {
    |     ---------------------------------------- function declared as const here
    |
    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable

Pinning to 0.4.6 solves the issue.

I'm using rustc 1.61.0-nightly (68369a041 2022-02-22)

Try updating to the latest nightly.

Ah, indeed, that solves it! Thanks for the quick reply!