Skip to content
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

rust: Fix compatibility of generated code with the 2024 edition #1119

Merged
merged 1 commit into from
Jan 9, 2025

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