Giter Club home page Giter Club logo

static-cell's Introduction

static-cell

crates.io crates.io Documentation

Statically allocated, initialized at runtime cell.

StaticCell provides a no-std-compatible, no-alloc way to reserve memory at compile time for a value, but initialize it at runtime, and get a 'static reference to it.

This is useful in the following scenarios:

  • You need &'static T, but T can't be constructed in const context so you can't simply use a static.
  • You need &'static mut T, not just &'static T.

Example

use static_cell::StaticCell;

// Statically allocate memory for a `u32`.
static SOME_INT: StaticCell<u32> = StaticCell::new();

// Initialize it at runtime. This returns a `&'static mut`.
let x: &'static mut u32 = SOME_INT.init(42);
assert_eq!(*x, 42);

// Trying to call `.init()` again would panic, because the StaticCell is already initialized.
// SOME_INT.init(42);

Alternatives

  • If you can use alloc, you can use Box::leak().
  • If you're OK with unsafe, you can use static mut THING: MaybeUninit<T>.
  • If you need just &'static T (instead of &'static mut T), there's OnceCell (not thread-safe though) or OnceLock (thread-safe, but requires std).

Interoperability

This crate uses portable-atomic, so on targets without native atomics you must import a crate that provides a critical-section implementation. See the critical-section README for details.

Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.56 and up. It might compile with older versions but that may change in any new patch release.

License

This work is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

static-cell's People

Contributors

ddystopia avatar dirbaio avatar elpiel avatar eziopan avatar isaacdynamo avatar jamesmunns avatar reitermarkus avatar zredshift avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

static-cell's Issues

make_static!() does not work anymore since rustc nightly-2024-06-13

make_static!() does not work anymore since rustc nightly-2024-06-13 or more precisely since this commit:
rust-lang/rust@02c7a59

Here is the detailed error I get when compiling with RUSTFLAGS="-Zmacro-backtrace":

error: item does not constrain `T::{opaque#0}`, but has it in its signature
   --> devel/embedded/static-cell/src/lib.rs:239:16
    |
234 | macro_rules! make_static {
    | ------------------------
    | |
    | in this expansion of `make_static!` (#1)
    | in this expansion of `$crate::make_static!` (#2)
235 |     ($val:expr) => ($crate::make_static!($val, ));
    |                     ---------------------------- in this macro invocation (#2)
...
239 |         static STATIC_CELL: $crate::StaticCell<T> = $crate::StaticCell::new();
    |                ^^^^^^^^^^^
    |
   ::: src/main.rs:133:24
    |
133 |     let merge_buffer = make_static!([0; 4096]);
    |                        ----------------------- in this macro invocation (#1)
    |
    = note: consider moving the opaque type's declaration and defining uses into a separate module
note: this opaque type is in the signature
   --> devel/embedded/static-cell/src/lib.rs:237:18
    |
234 | macro_rules! make_static {
    | ------------------------
    | |
    | in this expansion of `make_static!` (#1)
    | in this expansion of `$crate::make_static!` (#2)
235 |     ($val:expr) => ($crate::make_static!($val, ));
    |                     ---------------------------- in this macro invocation (#2)
236 |     ($val:expr, $(#[$m:meta])*) => {{
237 |         type T = impl ::core::marker::Sized;
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
   ::: src/main.rs:133:24
    |
133 |     let merge_buffer = make_static!([0; 4096]);
    |                        ----------------------- in this macro invocation (#1)

It seems the TAIT trick currently used in make_static!() is not allowed anymore. I tried to find an alternative without success.

Feature Request: Allow non-static reference due to lifetime invariance

Hello. My primary use case for static-cell is not to get &'static mut T, but to have T living in static allocation. But the problem is that T: 'static. So code like this would not compile:

    struct Foo<'a>(&'a i32);
    static FOO: StaticCell<Foo> = StaticCell::new();

    let num: i32 = 3;
    let value = Foo(&num);
    let foo = FOO.init(value);
383 |     let num: i32 = 3;
    |         --- binding `num` declared here
384 |     let value = Foo(&num);
    |                     ^^^^ borrowed value does not live long enough
385 |     let foo = FOO.init(value);
    |               --------------- argument requires that `num` is borrowed for `'static`
386 | }
    | - `num` dropped here while still borrowed

But that code with Box would:

    struct Foo<'a>(&'a i32);

    let num: i32 = 3;
    let value = Foo(&num);
    let foo = Box::leak(Box::new(value));

This is because of the bound Box::leak has:

    pub fn leak<'a>(b: Self) -> &'a mut T
    where
        A: 'a,

It returns any lifetime, including 'static, but also smaller ones

Can that same lifetime be on StaticCell::init? I don't know any use case where it is useful for ConsStaticCell though

Support issue for target "riscv32imc-unknown-none-elf"

When I was developing for my ESP-C3 chip, I used the "static_cell" crate, which uses "portable-atomic" for atomic support starting from version "1.3.0". Starting from this version, my project gets the following error when compiling:

error[E0433]: failed to resolve: could not find `AtomicU8` in `imp`
   --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:659:14
    |
659 |         imp::AtomicU8::is_lock_free()
    |              ^^^^^^^^ could not find `AtomicU8` in `imp`
    |
help: a struct with a similar name exists
    |
659 |         imp::AtomicU128::is_lock_free()
    |              ~~~~~~~~~~
help: consider importing this struct
    |
472 + use core::sync::atomic::AtomicU8;
    |
help: if you import `AtomicU8`, refer to it directly
    |
659 -         imp::AtomicU8::is_lock_free()
659 +         AtomicU8::is_lock_free()
    |

error[E0433]: failed to resolve: could not find `AtomicU8` in `imp`
   --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:681:14
    |
681 |         imp::AtomicU8::is_always_lock_free()
    |              ^^^^^^^^ could not find `AtomicU8` in `imp`
    |
help: a struct with a similar name exists
    |
681 |         imp::AtomicU128::is_always_lock_free()
    |              ~~~~~~~~~~
help: consider importing this struct
    |
472 + use core::sync::atomic::AtomicU8;
    |
help: if you import `AtomicU8`, refer to it directly
    |
681 -         imp::AtomicU8::is_always_lock_free()
681 +         AtomicU8::is_always_lock_free()
    |

error[E0412]: cannot find type `AtomicU8` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:1384:37
     |
1384 |     fn as_atomic_u8(&self) -> &imp::AtomicU8 {
     |                                     ^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/fallback/mod.rs:111:9
     |
111  |         pub(crate) struct $atomic_type {
     |         ------------------------------ similarly named struct `AtomicU128` defined here
     |
help: a struct with a similar name exists
     |
1384 |     fn as_atomic_u8(&self) -> &imp::AtomicU128 {
     |                                     ~~~~~~~~~~
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicU8;
     |
help: if you import `AtomicU8`, refer to it directly
     |
1384 -     fn as_atomic_u8(&self) -> &imp::AtomicU8 {
1384 +     fn as_atomic_u8(&self) -> &AtomicU8 {
     |

error[E0412]: cannot find type `AtomicU8` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:1387:56
     |
1387 |         unsafe { &*(self as *const Self as *const imp::AtomicU8) }
     |                                                        ^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/fallback/mod.rs:111:9
     |
111  |         pub(crate) struct $atomic_type {
     |         ------------------------------ similarly named struct `AtomicU128` defined here
     |
help: a struct with a similar name exists
     |
1387 |         unsafe { &*(self as *const Self as *const imp::AtomicU128) }
     |                                                        ~~~~~~~~~~
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicU8;
     |
help: if you import `AtomicU8`, refer to it directly
     |
1387 -         unsafe { &*(self as *const Self as *const imp::AtomicU8) }
1387 +         unsafe { &*(self as *const Self as *const AtomicU8) }
     |

error[E0412]: cannot find type `AtomicPtr` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:1409:17
     |
1409 |     inner: imp::AtomicPtr<T>,
     |                 ^^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/fallback/mod.rs:111:9
     |
111  |         pub(crate) struct $atomic_type {
     |         ------------------------------ similarly named struct `AtomicI64` defined here
     |
note: found an item that was configured out
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/mod.rs:269:60
     |
269  | pub(crate) use self::core_atomic::{AtomicI64, AtomicIsize, AtomicPtr, AtomicU64, AtomicUsize};
     |                                                            ^^^^^^^^^
help: a struct with a similar name exists
     |
1409 |     inner: imp::AtomicI64<T>,
     |                 ~~~~~~~~~
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicPtr;
     |
help: if you import `AtomicPtr`, refer to it directly
     |
1409 -     inner: imp::AtomicPtr<T>,
1409 +     inner: AtomicPtr<T>,
     |

error[E0433]: failed to resolve: could not find `AtomicPtr` in `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:1464:28
     |
1464 |         Self { inner: imp::AtomicPtr::new(p) }
     |                            ^^^^^^^^^ could not find `AtomicPtr` in `imp`
     |
help: a struct with a similar name exists
     |
1464 |         Self { inner: imp::AtomicI64::new(p) }
     |                            ~~~~~~~~~
help: consider importing one of these items
     |
472  + use core::sync::atomic::AtomicPtr;
     |
472  + use crate::AtomicPtr;
     |
help: if you import `AtomicPtr`, refer to it directly
     |
1464 -         Self { inner: imp::AtomicPtr::new(p) }
1464 +         Self { inner: AtomicPtr::new(p) }
     |

error[E0412]: cannot find type `AtomicPtr` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:1516:15
     |
1516 |         <imp::AtomicPtr<T>>::is_lock_free()
     |               ^^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/fallback/mod.rs:111:9
     |
111  |         pub(crate) struct $atomic_type {
     |         ------------------------------ similarly named struct `AtomicI64` defined here
     |
note: found an item that was configured out
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/mod.rs:269:60
     |
269  | pub(crate) use self::core_atomic::{AtomicI64, AtomicIsize, AtomicPtr, AtomicU64, AtomicUsize};
     |                                                            ^^^^^^^^^
help: a struct with a similar name exists
     |
1516 |         <imp::AtomicI64<T>>::is_lock_free()
     |               ~~~~~~~~~
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicPtr;
     |
help: if you import `AtomicPtr`, refer to it directly
     |
1516 -         <imp::AtomicPtr<T>>::is_lock_free()
1516 +         <AtomicPtr<T>>::is_lock_free()
     |

error[E0412]: cannot find type `AtomicPtr` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:1538:15
     |
1538 |         <imp::AtomicPtr<T>>::is_always_lock_free()
     |               ^^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/fallback/mod.rs:111:9
     |
111  |         pub(crate) struct $atomic_type {
     |         ------------------------------ similarly named struct `AtomicI64` defined here
     |
note: found an item that was configured out
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/mod.rs:269:60
     |
269  | pub(crate) use self::core_atomic::{AtomicI64, AtomicIsize, AtomicPtr, AtomicU64, AtomicUsize};
     |                                                            ^^^^^^^^^
help: a struct with a similar name exists
     |
1538 |         <imp::AtomicI64<T>>::is_always_lock_free()
     |               ~~~~~~~~~
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicPtr;
     |
help: if you import `AtomicPtr`, refer to it directly
     |
1538 -         <imp::AtomicPtr<T>>::is_always_lock_free()
1538 +         <AtomicPtr<T>>::is_always_lock_free()
     |

error[E0412]: cannot find type `AtomicIsize` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3953:17
     |
3953 |     atomic_int!(AtomicIsize, isize, 4);
     |                 ^^^^^^^^^^^ not found in `imp`
     |
note: found an item that was configured out
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/mod.rs:269:47
     |
269  | pub(crate) use self::core_atomic::{AtomicI64, AtomicIsize, AtomicPtr, AtomicU64, AtomicUsize};
     |                                               ^^^^^^^^^^^
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicIsize;
     |

error[E0433]: failed to resolve: could not find `AtomicIsize` in `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3953:17
     |
3953 |     atomic_int!(AtomicIsize, isize, 4);
     |                 ^^^^^^^^^^^ could not find `AtomicIsize` in `imp`
     |
help: consider importing one of these items
     |
472  + use core::sync::atomic::AtomicIsize;
     |
472  + use crate::AtomicIsize;
     |

error[E0412]: cannot find type `AtomicUsize` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3955:17
     |
3955 |     atomic_int!(AtomicUsize, usize, 4);
     |                 ^^^^^^^^^^^ not found in `imp`
     |
note: found an item that was configured out
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/mod.rs:269:82
     |
269  | pub(crate) use self::core_atomic::{AtomicI64, AtomicIsize, AtomicPtr, AtomicU64, AtomicUsize};
     |                                                                                  ^^^^^^^^^^^
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicUsize;
     |

error[E0433]: failed to resolve: could not find `AtomicUsize` in `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3955:17
     |
3955 |     atomic_int!(AtomicUsize, usize, 4);
     |                 ^^^^^^^^^^^ could not find `AtomicUsize` in `imp`
     |
help: consider importing one of these items
     |
472  + use core::sync::atomic::AtomicUsize;
     |
472  + use crate::AtomicUsize;
     |

error[E0412]: cannot find type `AtomicI8` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3967:17
     |
3967 |     atomic_int!(AtomicI8, i8, 1);
     |                 ^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/fallback/mod.rs:111:9
     |
111  |         pub(crate) struct $atomic_type {
     |         ------------------------------ similarly named struct `AtomicI128` defined here
     |
help: a struct with a similar name exists
     |
3967 |     atomic_int!(AtomicI128, i8, 1);
     |                 ~~~~~~~~~~
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicI8;
     |

error[E0433]: failed to resolve: could not find `AtomicI8` in `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3967:17
     |
3967 |     atomic_int!(AtomicI8, i8, 1);
     |                 ^^^^^^^^ could not find `AtomicI8` in `imp`
     |
help: a struct with a similar name exists
     |
3967 |     atomic_int!(AtomicI128, i8, 1);
     |                 ~~~~~~~~~~
help: consider importing one of these items
     |
472  + use core::sync::atomic::AtomicI8;
     |
472  + use crate::AtomicI8;
     |

error[E0412]: cannot find type `AtomicU8` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3968:17
     |
3968 |     atomic_int!(AtomicU8, u8, 1);
     |                 ^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/fallback/mod.rs:111:9
     |
111  |         pub(crate) struct $atomic_type {
     |         ------------------------------ similarly named struct `AtomicU128` defined here
     |
help: a struct with a similar name exists
     |
3968 |     atomic_int!(AtomicU128, u8, 1);
     |                 ~~~~~~~~~~
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicU8;
     |

error[E0433]: failed to resolve: could not find `AtomicU8` in `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3968:17
     |
3968 |     atomic_int!(AtomicU8, u8, 1);
     |                 ^^^^^^^^ could not find `AtomicU8` in `imp`
     |
help: a struct with a similar name exists
     |
3968 |     atomic_int!(AtomicU128, u8, 1);
     |                 ~~~~~~~~~~
help: consider importing one of these items
     |
472  + use core::sync::atomic::AtomicU8;
     |
472  + use crate::AtomicU8;
     |

error[E0412]: cannot find type `AtomicI16` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3971:17
     |
3971 |     atomic_int!(AtomicI16, i16, 2);
     |                 ^^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/fallback/mod.rs:111:9
     |
111  |         pub(crate) struct $atomic_type {
     |         ------------------------------ similarly named struct `AtomicI128` defined here
     |
help: a struct with a similar name exists
     |
3971 |     atomic_int!(AtomicI128, i16, 2);
     |                 ~~~~~~~~~~
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicI16;
     |

error[E0433]: failed to resolve: could not find `AtomicI16` in `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3971:17
     |
3971 |     atomic_int!(AtomicI16, i16, 2);
     |                 ^^^^^^^^^ could not find `AtomicI16` in `imp`
     |
help: a struct with a similar name exists
     |
3971 |     atomic_int!(AtomicI128, i16, 2);
     |                 ~~~~~~~~~~
help: consider importing one of these items
     |
472  + use core::sync::atomic::AtomicI16;
     |
472  + use crate::AtomicI16;
     |

error[E0412]: cannot find type `AtomicU16` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3972:17
     |
3972 |     atomic_int!(AtomicU16, u16, 2);
     |                 ^^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/fallback/mod.rs:111:9
     |
111  |         pub(crate) struct $atomic_type {
     |         ------------------------------ similarly named struct `AtomicU128` defined here
     |
help: a struct with a similar name exists
     |
3972 |     atomic_int!(AtomicU128, u16, 2);
     |                 ~~~~~~~~~~
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicU16;
     |

error[E0433]: failed to resolve: could not find `AtomicU16` in `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3972:17
     |
3972 |     atomic_int!(AtomicU16, u16, 2);
     |                 ^^^^^^^^^ could not find `AtomicU16` in `imp`
     |
help: a struct with a similar name exists
     |
3972 |     atomic_int!(AtomicU128, u16, 2);
     |                 ~~~~~~~~~~
help: consider importing one of these items
     |
472  + use core::sync::atomic::AtomicU16;
     |
472  + use crate::AtomicU16;
     |

error[E0412]: cannot find type `AtomicI32` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3975:17
     |
3975 |     atomic_int!(AtomicI32, i32, 4);
     |                 ^^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/fallback/mod.rs:111:9
     |
111  |         pub(crate) struct $atomic_type {
     |         ------------------------------ similarly named struct `AtomicI128` defined here
     |
help: a struct with a similar name exists
     |
3975 |     atomic_int!(AtomicI128, i32, 4);
     |                 ~~~~~~~~~~
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicI32;
     |

error[E0433]: failed to resolve: could not find `AtomicI32` in `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3975:17
     |
3975 |     atomic_int!(AtomicI32, i32, 4);
     |                 ^^^^^^^^^ could not find `AtomicI32` in `imp`
     |
help: a struct with a similar name exists
     |
3975 |     atomic_int!(AtomicI128, i32, 4);
     |                 ~~~~~~~~~~
help: consider importing one of these items
     |
472  + use core::sync::atomic::AtomicI32;
     |
472  + use crate::AtomicI32;
     |

error[E0412]: cannot find type `AtomicU32` in module `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2373:26
     |
2373 |         atomic_int!(int, AtomicU32, $int_type, $align);
     |                          ^^^^^^^^^
...
3976 |     atomic_int!(AtomicU32, u32, 4);
     |     ------------------------------ in this macro invocation
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/imp/fallback/mod.rs:111:9
     |
111  |         pub(crate) struct $atomic_type {
     |         ------------------------------ similarly named struct `AtomicU128` defined here
     |
     = note: this error originates in the macro `atomic_int` (in Nightly builds, run with -Z macro-backtrace for more info)
help: a struct with a similar name exists
     |
2373 |         atomic_int!(int, AtomicU128, $int_type, $align);
     |                          ~~~~~~~~~~
help: consider importing this struct
     |
472  + use core::sync::atomic::AtomicU32;
     |

error[E0433]: failed to resolve: could not find `AtomicU32` in `imp`
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2373:26
     |
2373 |         atomic_int!(int, AtomicU32, $int_type, $align);
     |                          ^^^^^^^^^ could not find `AtomicU32` in `imp`
...
3976 |     atomic_int!(AtomicU32, u32, 4);
     |     ------------------------------ in this macro invocation
     |
     = note: this error originates in the macro `atomic_int` (in Nightly builds, run with -Z macro-backtrace for more info)
help: a struct with a similar name exists
     |
2373 |         atomic_int!(int, AtomicU128, $int_type, $align);
     |                          ~~~~~~~~~~
help: consider importing one of these items
     |
472  + use core::sync::atomic::AtomicU32;
     |
472  + use crate::AtomicU32;
     |

   Compiling rand_core v0.6.4
   Compiling linked_list_allocator v0.10.5
error[E0282]: type annotations needed
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:1431:26
     |
1431 |         fmt::Debug::fmt(&self.load(Ordering::Relaxed), f)
     |                          ^^^^ cannot infer type for type parameter `T`

error[E0282]: type annotations needed
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:1439:28
     |
1439 |         fmt::Pointer::fmt(&self.load(Ordering::Relaxed), f)
     |                            ^^^^ cannot infer type for type parameter `T`

error: constant expression depends on a generic parameter
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:23
     |
13   |         let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:1463:9
     |
1463 |         static_assert_layout!(AtomicPtr<()>, *mut ());
     |         --------------------------------------------- in this macro invocation
     |
     = note: this may fail depending on what value the parameter takes
     = note: this error originates in the macro `static_assert` which comes from the expansion of the macro `static_assert_layout` (in Nightly builds, run with -Z macro-backtrace for more info)

error: constant expression depends on a generic parameter
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:18
     |
13   |         let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:1463:9
     |
1463 |         static_assert_layout!(AtomicPtr<()>, *mut ());
     |         --------------------------------------------- in this macro invocation
     |
     = note: this may fail depending on what value the parameter takes
     = note: this error originates in the macro `static_assert` which comes from the expansion of the macro `static_assert_layout` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:13
     |
13   |         let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |             ^^ expected `0`, found `true as usize - $crate::utils::_assert_is_bool($cond) as usize`
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:1463:9
     |
1463 |         static_assert_layout!(AtomicPtr<()>, *mut ());
     |         --------------------------------------------- in this macro invocation
     |
     = note: expected array `[(); 0]`
                found array `[(); true as usize - $crate::utils::_assert_is_bool($cond) as usize]`
     = note: this error originates in the macro `static_assert` which comes from the expansion of the macro `static_assert_layout` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0282]: type annotations needed
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:1974:13
     |
1974 |             self.as_atomic_usize().fetch_add(val, order) as *mut T
     |             ^^^^ cannot infer type for type parameter `T`

error[E0282]: type annotations needed
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2018:13
     |
2018 |             self.as_atomic_usize().fetch_sub(val, order) as *mut T
     |             ^^^^ cannot infer type for type parameter `T`

error[E0282]: type annotations needed
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2077:13
     |
2077 |             self.as_atomic_usize().fetch_or(val, order) as *mut T
     |             ^^^^ cannot infer type for type parameter `T`

error[E0282]: type annotations needed
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2134:13
     |
2134 |             self.as_atomic_usize().fetch_and(val, order) as *mut T
     |             ^^^^ cannot infer type for type parameter `T`

error[E0282]: type annotations needed
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2190:13
     |
2190 |             self.as_atomic_usize().fetch_xor(val, order) as *mut T
     |             ^^^^ cannot infer type for type parameter `T`

error[E0282]: type annotations needed
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2238:13
     |
2238 |             self.as_atomic_usize().bit_set(bit, order)
     |             ^^^^ cannot infer type for type parameter `T`

error[E0282]: type annotations needed
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2283:13
     |
2283 |             self.as_atomic_usize().bit_clear(bit, order)
     |             ^^^^ cannot infer type for type parameter `T`

error[E0282]: type annotations needed
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2328:13
     |
2328 |             self.as_atomic_usize().bit_toggle(bit, order)
     |             ^^^^ cannot infer type for type parameter `T`

error: constant expression depends on a generic parameter
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:23
     |
13   |           let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2335:9
     |
2335 | /         static_assert!(
2336 | |             core::mem::size_of::<AtomicPtr<()>>() == core::mem::size_of::<AtomicUsize>()
2337 | |         );
     | |_________- in this macro invocation
     |
     = note: this may fail depending on what value the parameter takes
     = note: this error originates in the macro `static_assert` (in Nightly builds, run with -Z macro-backtrace for more info)

error: constant expression depends on a generic parameter
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:18
     |
13   |           let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2335:9
     |
2335 | /         static_assert!(
2336 | |             core::mem::size_of::<AtomicPtr<()>>() == core::mem::size_of::<AtomicUsize>()
2337 | |         );
     | |_________- in this macro invocation
     |
     = note: this may fail depending on what value the parameter takes
     = note: this error originates in the macro `static_assert` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:13
     |
13   |           let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |               ^^ expected `0`, found `true as usize - $crate::utils::_assert_is_bool($cond) as usize`
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2335:9
     |
2335 | /         static_assert!(
2336 | |             core::mem::size_of::<AtomicPtr<()>>() == core::mem::size_of::<AtomicUsize>()
2337 | |         );
     | |_________- in this macro invocation
     |
     = note: expected array `[(); 0]`
                found array `[(); true as usize - $crate::utils::_assert_is_bool($cond) as usize]`
     = note: this error originates in the macro `static_assert` (in Nightly builds, run with -Z macro-backtrace for more info)

error: constant expression depends on a generic parameter
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:23
     |
13   |           let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2338:9
     |
2338 | /         static_assert!(
2339 | |             core::mem::align_of::<AtomicPtr<()>>() == core::mem::align_of::<AtomicUsize>()
2340 | |         );
     | |_________- in this macro invocation
     |
     = note: this may fail depending on what value the parameter takes
     = note: this error originates in the macro `static_assert` (in Nightly builds, run with -Z macro-backtrace for more info)

error: constant expression depends on a generic parameter
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:18
     |
13   |           let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2338:9
     |
2338 | /         static_assert!(
2339 | |             core::mem::align_of::<AtomicPtr<()>>() == core::mem::align_of::<AtomicUsize>()
2340 | |         );
     | |_________- in this macro invocation
     |
     = note: this may fail depending on what value the parameter takes
     = note: this error originates in the macro `static_assert` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:13
     |
13   |           let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |               ^^ expected `0`, found `true as usize - $crate::utils::_assert_is_bool($cond) as usize`
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:2338:9
     |
2338 | /         static_assert!(
2339 | |             core::mem::align_of::<AtomicPtr<()>>() == core::mem::align_of::<AtomicUsize>()
2340 | |         );
     | |_________- in this macro invocation
     |
     = note: expected array `[(); 0]`
                found array `[(); true as usize - $crate::utils::_assert_is_bool($cond) as usize]`
     = note: this error originates in the macro `static_assert` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:13
     |
13   |         let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |             ^^ expected `0`, found `true as usize - $crate::utils::_assert_is_bool($cond) as usize`
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3953:5
     |
3953 |     atomic_int!(AtomicIsize, isize, 4);
     |     ---------------------------------- in this macro invocation
     |
     = note: expected array `[(); 0]`
                found array `[(); true as usize - $crate::utils::_assert_is_bool($cond) as usize]`
     = note: this error originates in the macro `static_assert` which comes from the expansion of the macro `atomic_int` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:13
     |
13   |         let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |             ^^ expected `0`, found `true as usize - $crate::utils::_assert_is_bool($cond) as usize`
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3955:5
     |
3955 |     atomic_int!(AtomicUsize, usize, 4);
     |     ---------------------------------- in this macro invocation
     |
     = note: expected array `[(); 0]`
                found array `[(); true as usize - $crate::utils::_assert_is_bool($cond) as usize]`
     = note: this error originates in the macro `static_assert` which comes from the expansion of the macro `atomic_int` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:13
     |
13   |         let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |             ^^ expected `0`, found `true as usize - $crate::utils::_assert_is_bool($cond) as usize`
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3967:5
     |
3967 |     atomic_int!(AtomicI8, i8, 1);
     |     ---------------------------- in this macro invocation
     |
     = note: expected array `[(); 0]`
                found array `[(); true as usize - $crate::utils::_assert_is_bool($cond) as usize]`
     = note: this error originates in the macro `static_assert` which comes from the expansion of the macro `atomic_int` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:13
     |
13   |         let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |             ^^ expected `0`, found `true as usize - $crate::utils::_assert_is_bool($cond) as usize`
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3968:5
     |
3968 |     atomic_int!(AtomicU8, u8, 1);
     |     ---------------------------- in this macro invocation
     |
     = note: expected array `[(); 0]`
                found array `[(); true as usize - $crate::utils::_assert_is_bool($cond) as usize]`
     = note: this error originates in the macro `static_assert` which comes from the expansion of the macro `atomic_int` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:13
     |
13   |         let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |             ^^ expected `0`, found `true as usize - $crate::utils::_assert_is_bool($cond) as usize`
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3971:5
     |
3971 |     atomic_int!(AtomicI16, i16, 2);
     |     ------------------------------ in this macro invocation
     |
     = note: expected array `[(); 0]`
                found array `[(); true as usize - $crate::utils::_assert_is_bool($cond) as usize]`
     = note: this error originates in the macro `static_assert` which comes from the expansion of the macro `atomic_int` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:13
     |
13   |         let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |             ^^ expected `0`, found `true as usize - $crate::utils::_assert_is_bool($cond) as usize`
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3972:5
     |
3972 |     atomic_int!(AtomicU16, u16, 2);
     |     ------------------------------ in this macro invocation
     |
     = note: expected array `[(); 0]`
                found array `[(); true as usize - $crate::utils::_assert_is_bool($cond) as usize]`
     = note: this error originates in the macro `static_assert` which comes from the expansion of the macro `atomic_int` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:13
     |
13   |         let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |             ^^ expected `0`, found `true as usize - $crate::utils::_assert_is_bool($cond) as usize`
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3975:5
     |
3975 |     atomic_int!(AtomicI32, i32, 4);
     |     ------------------------------ in this macro invocation
     |
     = note: expected array `[(); 0]`
                found array `[(); true as usize - $crate::utils::_assert_is_bool($cond) as usize]`
     = note: this error originates in the macro `static_assert` which comes from the expansion of the macro `atomic_int` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/utils.rs:13:13
     |
13   |         let [] = [(); true as usize - $crate::utils::_assert_is_bool($cond) as usize];
     |             ^^ expected `0`, found `true as usize - $crate::utils::_assert_is_bool($cond) as usize`
     |
    ::: /Users/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.5.1/src/lib.rs:3976:5
     |
3976 |     atomic_int!(AtomicU32, u32, 4);
     |     ------------------------------ in this macro invocation
     |
     = note: expected array `[(); 0]`
                found array `[(); true as usize - $crate::utils::_assert_is_bool($cond) as usize]`
     = note: this error originates in the macro `static_assert` which comes from the expansion of the macro `atomic_int` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0282, E0308, E0412, E0433.
For more information about an error, try `rustc --explain E0282`.
error: could not compile `portable-atomic` (lib) due to 62 previous errors
warning: build failed, waiting for other jobs to finish...

My "rustflags" configuration is as follows:

rustflags = [
  "-C", "link-arg=-Tlinkall.x",

  # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.)
  # NOTE: May negatively impact performance of produced code
  "-C", "force-frame-pointers",

  # comment the cfgs below if you do _not_ wish to emulate atomics.
  # enable the atomic codegen option for RISCV
  "-C", "target-feature=+a",
  # tell the core library have atomics even though it's not specified in the target definition
  "--cfg", "target_has_atomic_load_store",
  "--cfg", 'target_has_atomic_load_store="8"',
  "--cfg", 'target_has_atomic_load_store="16"',
  "--cfg", 'target_has_atomic_load_store="32"',
  "--cfg", 'target_has_atomic_load_store="ptr"',
  # enable cas
  "--cfg", "target_has_atomic",
  "--cfg", 'target_has_atomic="8"',
  "--cfg", 'target_has_atomic="16"',
  "--cfg", 'target_has_atomic="32"',
  "--cfg", 'target_has_atomic="ptr"',
]

The compilation tool chain of the "nightly" channel is used.

Add option to specify the attrs over the static (such as `link_section`) in the newly added `make_static` macro

For ESP32 development, often I want to offload the large static buffers to PSRAM, instead of internal memory. The macro is really handy but doesn't work in these cases. Adding a base variant like

macro_rules! make_static {
    ($val:expr, $(#[$m:meta])*) => {{
        type T = impl ::core::marker::Sized;
        $(#[$m])*
        static STATIC_CELL: $crate::StaticCell<T> = $crate::StaticCell::new();
        let (x,) = unsafe { STATIC_CELL.uninit().write(($val,)) };
        x
    }};
}

would allow to specify the link_section to store it in external RAM bss and would solve this issue. What do you think?

no method named `compare_exchange` found for struct `portable_atomic::AtomicBool` in the current scope (on thumbv6m-none-eabi)

Trying to use StaticCell with this pi-pico example: https://github.com/gauteh/defmt-serial/blob/main/example-pi-pico/src/main.rs fails with:

❯ cargo build
   Compiling nb v1.1.0
   Compiling void v1.0.2
   Compiling vcell v0.1.3
   Compiling bare-metal v0.2.5
   Compiling bitfield v0.13.2
   Compiling critical-section v1.1.2
   Compiling num_enum v0.5.11
   Compiling cortex-m-rt v0.7.3
   Compiling nb v0.1.3
   Compiling volatile-register v0.2.1
   Compiling stable_deref_trait v1.2.0
   Compiling either v1.9.0
   Compiling gcd v2.3.0
   Compiling bitflags v1.3.2
   Compiling arrayvec v0.7.4
   Compiling embedded-hal v0.2.7
   Compiling embedded-dma v0.2.0
   Compiling defmt v0.3.5
   Compiling bare-metal v1.0.0
   Compiling fugit v0.3.7
   Compiling itertools v0.10.5
   Compiling usb-device v0.2.9
   Compiling rand_core v0.6.4
   Compiling critical-section v0.2.8
   Compiling cortex-m v0.7.7
   Compiling rp2040-boot2 v0.2.1
   Compiling pio v0.2.1
   Compiling portable-atomic v1.6.0
   Compiling panic-halt v0.2.0
   Compiling rp2040-pac v0.4.0
   Compiling defmt-serial v0.6.0
   Compiling static_cell v2.0.0
   Compiling panic-probe v0.3.1
error[E0599]: no method named `compare_exchange` found for struct `portable_atomic::AtomicBool` in the current scope
   --> /home/gauteh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/static_cell-2.0.0/src/lib.rs:122:14
    |
120 |           if self
    |  ____________-
121 | |             .used
122 | |             .compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed)
    | |             -^^^^^^^^^^^^^^^^ method not found in `AtomicBool`
    | |_____________|
    |

For more information about this error, try `rustc --explain E0599`.
error: could not compile `static_cell` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.