Open Altanis opened 10 months ago
I have the same problem. I wanted to use color-eyre 0.6.2 which uses the latest verison here. I really wonder how this does not attract more attention. I'm using rust 1.76 tough, maybe that's the probelm.
Can you share what RUSTFLAGS
you've set and what features are enabled?
Hi, I basically tried to build this template repo through cargo-generate: here (which I don't know much about) With a fresh repo and only sharded-slabs as a dependency, it compiles. Again, clean cargo init and color-eyre as my only dependency it fails with the same error. This is the dependency which throws the error in the first place. This is my rustup:
installed toolchains
--------------------
stable-x86_64-apple-darwin (default)
nightly-x86_64-apple-darwin
1.48.0-x86_64-apple-darwin
1.76.0-x86_64-apple-darwin
active toolchain
----------------
stable-x86_64-apple-darwin (default)
rustc 1.75.0 (82e1608df 2023-12-21)
I also tried it with nighlty and rustc 1.78.0 but the same happens. For Rustflags I think I use all the defaults. But I don't know how to doubble check. I also get kind of similar errors when I compile the console crate and they are all related to the lazy_static macro and lifetimes. Hope this helps.
I'm also having this issue, Rust 1.76 stable, but I'm on M1 (arm) apple, not x86.
I also filed this under lazy_static: https://github.com/rust-lang-nursery/lazy-static.rs/issues/217
Other resources I found: https://stackoverflow.com/questions/77710297/encountered-e0195-lifetime-parameters-or-bounds-on-type-target-do-not-match
I just hit this issue on rustc 1.78.0. I tried clearing the cargo registry (rm -rf ~/.cargo/registry/index
), and uninstalling + reinstalling rustup/cargo. Neither fix worked for me.
I usually have RUSTC_BOOTSTRAP=1
and __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="dev"
set in my .*rc, which may be related. Un-setting those allowed the build to succeed, and the build continues to succeed with them re-set, even after a cargo clean && rm -rf ~/.cargo/registry/index
. If anyone else hits this issue, I would recommend (un)setting those env vars, and then re-setting to your baseline, see if that helps.
I sincerely hope that no one else has to go looking for advice on this, though.
Well, that's certainly strange!
Target
do not match the trait declaration --> /Users/altanis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/tid.rs:32:1= note: this error originates in the macro
__lazy_static_internal
which comes from the expansion of the macrolazy_static
(in Nightly builds, run with -Z macro-backtrace for more info)free
on typeREGISTRY
--> /Users/altanis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/tid.rs:150:14next
on typeREGISTRY
--> /Users/altanis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/tid.rs:161:35free
on typeREGISTRY
--> /Users/altanis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sharded-slab-0.1.7/src/tid.rs:191:42Some errors have detailed explanations: E0195, E0609. For more information about an error, try
rustc --explain E0195
. error: could not compilesharded-slab
(lib) due to 4 previous errors warning: build failed, waiting for other jobs to finish...