-
Notifications
You must be signed in to change notification settings - Fork 17
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
make_static!() does not work anymore since rustc nightly-2024-06-13 #16
Comments
yes, this is quite annoying. I've also failed to find an alternative! :( |
kesyog
added a commit
to kesyog/hangman
that referenced
this issue
Jul 6, 2024
static-cell's `make_static!` macro is broken in latest nightly: embassy-rs/static-cell#16 Re-implement it by dropping the automatic type deduction magic.
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 #[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)
}};
} |
Is there any solution in sight? Could we add this to the standard library? ( probably requires compiler intrinsics, but I'm no expert) |
4 tasks
pmnxis
added a commit
to pmnxis/rusty-probe-firmware
that referenced
this issue
Sep 11, 2024
Current rust embedded eco system has problem since rustc nightly 2024-06-13. This would be related with this report embassy-rs/static-cell#16 Checked some of rust embedded project pass compile on 2024-06-12 include this repo.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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"
:It seems the TAIT trick currently used in
make_static!()
is not allowed anymore. I tried to find an alternative without success.The text was updated successfully, but these errors were encountered: