Skip to content

Conversation

@yutannihilation
Copy link
Contributor

This supersedes #3.

The problem is that, while this template uses edition 2021, cargo generate generates a crate with the default edition of the toolchain. So, this compile failure is what a user would see if they uses the latest stable version of Rust.

error: unsafe attribute used without unsafe
  --> src\main.rs:77:3
   |
77 | #[link_section = ".bi_entries"]
   |   ^^^^^^^^^^^^ usage of unsafe attribute
   |
help: wrap the attribute in `unsafe(...)`
   |
77 | #[unsafe(link_section = ".bi_entries")]
   |   +++++++                            +

error: could not compile `rp235x-project-template` (bin "rp235x-project-template") due to 1 previous error

Marking the attribute in unsafe(...) doesn't require Rust 2024 edition (this syntax is valid since Rust 1.82 as suggested in #3 (comment)), but, since this repository is tested against the stable and nightly version, I think it's a good idea to test with the default edition of such toolchains.

Copy link
Member

@9names 9names left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!
Closes #3

@9names 9names merged commit caca96c into rp-rs:main Aug 29, 2025
8 checks passed
@yutannihilation yutannihilation deleted the use-rust-2024 branch August 29, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants