Skip to content

Various attributes and extern "C" must be marked "unsafe" to compile generated code #933

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Plaba
Copy link

@Plaba Plaba commented May 14, 2025

tested against RA4M1 SVD

tested on rustc 1.86.0 svd2rust 0.36.1

@Plaba Plaba requested a review from a team as a code owner May 14, 2025 04:21
@Emilgardis
Copy link
Member

This is due to edition change, use 2021 edition in Cargo.toml to resolve. I remember an issue where we discussed how to solve this but I can't find it anymore

@burrbull
Copy link
Member

but I can't find it anymore

#891

1.82.0 Released on: 17 October, 2024

@burrbull
Copy link
Member

burrbull commented Jun 8, 2025

@therealprof What do you think? Should we bump rust to 1.82 and fix this or stay on edition 2021?

@jannic
Copy link
Member

jannic commented Jun 17, 2025

Should we bump rust to 1.82 and fix this or stay on edition 2021

Edition 2024 needs rust 1.85.

@therealprof
Copy link
Contributor

@therealprof What do you think? Should we bump rust to 1.82 and fix this or stay on edition 2021?

As discussed in our weekly meeting just now, we see very little upside in bumping to edition 2024 at this time and some major downsides, like not being able to build the generated PACs with Ferrocene for the time being. Since crates can be build with different editions there doesn't seem to be an obvious reason to make the jump now.

It would be good to know if we missed something important. @Plaba

@burrbull
Copy link
Member

burrbull commented Jun 17, 2025

Ok. Another suggestion. Support 2 rust versions.

What do you think about support by default last stable version of Rust?
But also add --rust-1.76 option (or just --msrv) which allows to generate code acceptable by old compilers?

@BartMassey
Copy link
Member

@burrbull We did discuss adding a --edition=2024 flag to svd2rust (with some earlier Rust version as default); also adding cfg(edition="2024") flags to the generated code. The consensus was that things are working OK as-is as far as we know, so we chose not to put in the work yet.

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.

6 participants