Merged
Conversation
(These will be updated to 2024 in a separate commit.) The only change required is in a macro, where spaces are needed before `#` to avoid a "prefixed identifiers and literals are reserved since Rust 2021" error.
ece194a to
9ed1146
Compare
Three kinds of changes are required. - Unsafe operations within unsafe functions now need to be explicitly marked with `unsafe`. - `#[no_mangle]` now must be `#[unsafe(no_mangle)]`. - `gen` is now a keyword. - `cargo fmt` formats some things slightly different in edition 2024. - `env::set_var` is now unsafe. - Clippy wants nested `if`s to be chained where possible.
Three kinds of changes are required.
- Unsafe operations within unsafe functions now need to be explicitly
marked with `unsafe`.
- This requires setting `.wrap_unsafe_ops` for unsafe functions
generated by bindgen.
- `extern "C"` blocks now need to be marked as unsafe.
- `cargo fmt` formats some things slightly different in edition 2024.
Again, all the unsafe operations within unsafe functions now need explicit `unsafe` marking.
9ed1146 to
a072502
Compare
LegNeato
approved these changes
Dec 10, 2025
Contributor
LegNeato
left a comment
There was a problem hiding this comment.
Lots of changes, hard to review. Tests passing so 🚀
nnethercote
added a commit
to nnethercote/Rust-CUDA
that referenced
this pull request
Dec 11, 2025
The merging of two unintentionally interdependent PRs left `path-tracer` in a broken state. - Rust-GPU#335 updated it from edition 2018 to 2024, while it was disabled (commented out). - Rust-GPU#332 re-enabled it. This left it marked as using edition 2024 but without the appropriate changes for edition 2024. This commit makes those changes.
Merged
LegNeato
pushed a commit
that referenced
this pull request
Dec 11, 2025
The merging of two unintentionally interdependent PRs left `path-tracer` in a broken state. - #335 updated it from edition 2018 to 2024, while it was disabled (commented out). - #332 re-enabled it. This left it marked as using edition 2024 but without the appropriate changes for edition 2024. This commit makes those changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rust CUDA uses a mix of 2018, 2021 and 2024 editions. It's worth updating to 2024 across the board to promote the idea that the project has been rebooted and is in active development again.
The most significant change is that Rust 2024 requires unsafe operations in unsafe functions to be marked explicitly as unsafe. In particular, this affects kernels.