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

error[E0195]: lifetime parameters or bounds on type Target #217

Open
simbleau opened this issue Mar 10, 2024 · 3 comments
Open

error[E0195]: lifetime parameters or bounds on type Target #217

simbleau opened this issue Mar 10, 2024 · 3 comments

Comments

@simbleau
Copy link

Not long ago, basically any crate that uses lazy_static just halted working for me. I even uninstalled rust and reinstalled it. I'm on M1 apple, Rust 1.76 stable. Not sure what's going on, does anyone have any clues?

Rust:

12:47 simbleau on bevy-0.13-dev ~ rustup show          
Default host: aarch64-apple-darwin
rustup home:  /Users/simbleau/.rustup

stable-aarch64-apple-darwin (default)
rustc 1.76.0 (07dca489a 2024-02-04)

Stack trace:


   Compiling tracing-log v0.1.4
   Compiling libloading v0.8.1
   Compiling accesskit v0.12.2
error[E0195]: lifetime parameters or bounds on type `Target` do not match the trait declaration
  --> /Users/simbleau/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/tid.rs:32:1
   |
32 | / lazy_static! {
33 | |     static ref REGISTRY: Registry = Registry {
34 | |         next: AtomicUsize::new(0),
35 | |         free: Mutex::new(VecDeque::new()),
36 | |     };
37 | | }
   | |_^ lifetimes do not match type in trait
   |
   = note: this error originates in the macro `__lazy_static_internal` which comes from the expansion of the macro `lazy_static` (in Nightly builds, run with -Z macro-backtrace for more info)

   Compiling parking_lot_core v0.9.9
   Compiling wgpu-types v0.19.2
   Compiling metal v0.27.0
error[E0609]: no field `free` on type `REGISTRY`
   --> /Users/simbleau/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/tid.rs:150:14
    |
150 |             .free
    |              ^^^^ unknown field
    |
    = note: available field is: `__private_field`

error[E0609]: no field `next` on type `REGISTRY`
   --> /Users/simbleau/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/tid.rs:161:35
    |
161 |                 let id = REGISTRY.next.fetch_add(1, Ordering::AcqRel);
    |                                   ^^^^ unknown field
    |
    = note: available field is: `__private_field`

error[E0609]: no field `free` on type `REGISTRY`
   --> /Users/simbleau/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/tid.rs:191:42
    |
191 |             let mut free_list = REGISTRY.free.lock().unwrap_or_else(PoisonError::into_inner);
    |                                          ^^^^ unknown field
    |
    = note: available field is: `__private_field`

Some errors have detailed explanations: E0195, E0609.
For more information about an error, try `rustc --explain E0195`.
error: could not compile `sharded-slab` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
@Cr0a3
Copy link

Cr0a3 commented Jun 2, 2024

I get the same error, how did you fixed it?

@simbleau
Copy link
Author

simbleau commented Jun 4, 2024

I think I just moved over to once_cell instead of lazy_static.

This crate is basically abandoned

@Cr0a3
Copy link

Cr0a3 commented Jun 4, 2024

Thanks

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

No branches or pull requests

2 participants