-
Notifications
You must be signed in to change notification settings - Fork 168
fix(coretex-m-rt-macros): Allow #[unsafe(link_section = )]
for Rust 2024 edition
#596
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
fix(coretex-m-rt-macros): Allow #[unsafe(link_section = )]
for Rust 2024 edition
#596
Conversation
Looks good to me. |
How does this PR figure out whether edition 2024 is in play or not? Or is that up to the user to figure out? It would be nice if there was a way to provide guidance about that change between editions. |
|
Sounds excellent to me then. No concerns. 😄 |
Thanks for reviewing! |
The docs currently state an MSRV of 1.61: Lines 35 to 36 in c04e4db
Line 14 in c04e4db
cortex-m/cortex-m-rt/README.md Lines 14 to 15 in c04e4db
cortex-m/cortex-m-rt/src/lib.rs Line 482 in c04e4db
|
This doesn't affect MSRV. People can still use the old "safe" |
Rust 2024 edition requires marking
link_section
attribute asunsafe
. Otherwise, the compilation fails with the following error.https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-attributes.html
However, if I use
#[unsafe(link_section = ".bi_entries")]
, cortex-m-crate complains that it's not allowed (cf. embassy-rs/embassy#4170).This pull request tweaks the check logic to allow this notation so that users can use Rust 2024 edition.