Open aurelj opened 1 month ago
yes, this is quite annoying. I've also failed to find an alternative! :(
It's not as ergonomic, but I did the simple/naive thing in my project and fixed this by making a new version of the make_static!
macro that adds an extra argument to pass in the type:
#[macro_export]
macro_rules! make_static {
($t:ty, $val:expr) => ($crate::make_static!($t, $val,));
($t:ty, $val:expr, $(#[$m:meta])*) => {{
$(#[$m])*
static STATIC_CELL: static_cell::StaticCell<$t> = static_cell::StaticCell::new();
STATIC_CELL.init_with(|| $val)
}};
}
make_static!()
does not work anymore since rustc nightly-2024-06-13 or more precisely since this commit: https://github.com/rust-lang/rust/commit/02c7a5921e3de5c2b3ecb2e0082c1dafce0729a1Here is the detailed error I get when compiling with
RUSTFLAGS="-Zmacro-backtrace"
:It seems the TAIT trick currently used in
make_static!()
is not allowed anymore. I tried to find an alternative without success.