Skip to content

Conversation

@alexcrichton
Copy link
Member

This commit fixes compatibility of generated code with the Rust 2024 edition coming up next month. The new edition requires that #[export_name] is notably an unsafe attribute and is wrapped in #[unsafe(export_name = "...")] so the generated code is updated to do that. Note that this syntax is allowed on the 2021 edition as of Rust 1.82.0 but is not required, it's only required in the 2024 edition.

This commit fixes compatibility of generated code with the Rust 2024
edition coming up next month. The new edition requires that
`#[export_name]` is notably an `unsafe` attribute and is wrapped in
`#[unsafe(export_name = "...")]` so the generated code is updated to do
that. Note that this syntax is allowed on the 2021 edition as of Rust
1.82.0 but is not required, it's only required in the 2024 edition.
Copy link
Collaborator

@jsturtevant jsturtevant left a comment

Choose a reason for hiding this comment

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

LGTM

@alexcrichton alexcrichton added this pull request to the merge queue Jan 9, 2025
Merged via the queue into bytecodealliance:main with commit 51e1ef5 Jan 9, 2025
25 checks passed
@alexcrichton alexcrichton deleted the unsafe-attributes branch January 9, 2025 21:51
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