Skip to content

Conversation

kurtjd
Copy link

@kurtjd kurtjd commented Sep 20, 2025

In edition 2024, #[warn(unsafe_op_in_unsafe_fn)] is enabled by default.

This PR adds the unsafe block around mutating DEVICE_PERIPHERALS in the generated Peripherals::steal() function. I had considered only adding this if the --edition=2024 flag was passed, but there is no harm in this being here even for earlier editions and is IMO clearer regardless. Though if folks disagree I can make that change.

@burrbull
Copy link
Member

I can make that change

Make this, please.

@kurtjd kurtjd force-pushed the add-unsafe-device-peripherals branch from 3d7e14c to e7ca4fb Compare October 2, 2025 03:49
@kurtjd
Copy link
Author

kurtjd commented Oct 2, 2025

I can make that change

Make this, please.

Done!

burrbull
burrbull previously approved these changes Oct 2, 2025
@kurtjd
Copy link
Author

kurtjd commented Oct 2, 2025

Hm CI appears to be failing for reasons unrelated to these changes. Would you like me to make the fix as part of this PR anyway?

@burrbull
Copy link
Member

burrbull commented Oct 2, 2025

Yes, try to fix it, please.

@kurtjd kurtjd force-pushed the add-unsafe-device-peripherals branch from fa2e372 to a5ecffa Compare October 2, 2025 05:28
@kurtjd
Copy link
Author

kurtjd commented Oct 2, 2025

Yes, try to fix it, please.

Should be fixed now. Looks like this PR: rust-lang/rust#138907 merged doc_auto_cfg into doc_cfg and nightly no longer supports the old name, so I updated this to generate PACs with the new name. This allows docs to be built with nightly, now allowing CI to pass.

@kurtjd
Copy link
Author

kurtjd commented Oct 2, 2025

So svd2rust-regress completed locally for me with no errors, but during CI looks like it's failing because clippy is not installed. I'll see if I can update the workflow to ensure clippy is available during CI.

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.

2 participants