Skip to content

transpile: upgrade most things for edition 2024#1643

Merged
kkysen merged 42 commits intomasterfrom
kkysen/transpile-edition-2024
Mar 14, 2026
Merged

transpile: upgrade most things for edition 2024#1643
kkysen merged 42 commits intomasterfrom
kkysen/transpile-edition-2024

Conversation

@kkysen
Copy link
Contributor

@kkysen kkysen commented Mar 6, 2026

This fixes the following differences with edition 2024:

This also runs the correct rustfmt, as we were previously just picking up whichever one rustup resolved.

This updates all of the transpiler snapshot tests and tests/unit/ tests that work on edition 2024 with the above fixes. The remaining fixes I'll fix in separate PRs, as they might be trickier.

@kkysen kkysen force-pushed the kkysen/transpile-tests-separate-snapshot-tests branch from f86aec4 to d1ae9eb Compare March 6, 2026 08:32
@kkysen kkysen force-pushed the kkysen/transpile-edition-2024 branch from 19c6138 to db5a90e Compare March 6, 2026 08:34
@kkysen kkysen force-pushed the kkysen/transpile-tests-separate-snapshot-tests branch from d1ae9eb to 02b9ca2 Compare March 6, 2026 08:36
@kkysen kkysen force-pushed the kkysen/transpile-edition-2024 branch 5 times, most recently from 73c45e4 to 1a4774e Compare March 6, 2026 13:18
@Rua
Copy link
Contributor

Rua commented Mar 6, 2026

In the 2024 edition, the unsafe-op-in-unsafe-fn lint now also warns by default. A simple fix could be to just add an extra unsafe { } block to each function, but ultimately marking only the actual unsafe operations as unsafe could be preferred.

@kkysen kkysen force-pushed the kkysen/transpile-edition-2024 branch 3 times, most recently from 9af29df to 43f7566 Compare March 6, 2026 22:54
@kkysen kkysen force-pushed the kkysen/transpile-tests-separate-snapshot-tests branch from 02b9ca2 to b3ab33d Compare March 6, 2026 22:56
@kkysen kkysen force-pushed the kkysen/transpile-edition-2024 branch 2 times, most recently from 5ecf3f2 to 6d4cba2 Compare March 6, 2026 23:20
Copy link
Contributor Author

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

In the 2024 edition, the unsafe-op-in-unsafe-fn lint now also warns by default. A simple fix could be to just add an extra unsafe { } block to each function, but ultimately marking only the actual unsafe operations as unsafe could be preferred.

It's still just a warning, and we have plenty of warnings already, so I don't think I'll fix it as part of this PR, but you're right, we should fix it. We can do an outer unsafe {} block first, and if possible, narrow it.

@kkysen kkysen force-pushed the kkysen/transpile-edition-2024 branch 2 times, most recently from 2273281 to a70695c Compare March 6, 2026 23:51
Base automatically changed from kkysen/transpile-tests-separate-snapshot-tests to master March 6, 2026 23:52
@kkysen kkysen force-pushed the kkysen/transpile-edition-2024 branch 2 times, most recently from 2050f67 to 9bbfccc Compare March 8, 2026 01:02
@kkysen kkysen force-pushed the kkysen/transpile-edition-2024 branch 2 times, most recently from dc3a8b4 to 220a2dd Compare March 11, 2026 21:18
@kkysen kkysen requested a review from ahomescu March 11, 2026 21:19
kkysen added 26 commits March 13, 2026 13:34
…e suffixes so that related files are next to each
This easy to do, gives better test coverage,
and allows us to see the failing snapshots on edition 2024
for tests that haven't been converted yet.
…`test_*.rs` files

This allows us to move individual test directories to edition 2024.
`Edition2024` more closely matches what we normally call it.
…st, too

This comments out the `__APPLE__`-specific behavior so that the snapshot remains platform-independent.
We're mostly interested in testing the other attributes, so this should be fine for now.

This tests that `271228774` is working as intended.
@kkysen kkysen force-pushed the kkysen/transpile-edition-2024 branch from 220a2dd to 79cae37 Compare March 13, 2026 20:37
}

/// Whether attributes can be `unsafe` in this edition.
fn attr_unsafety(edition: RustEdition) -> Unsafety {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be named slightly better, e.g., attr_needs_unsafe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I feel like attr_needs_unsafe implies it'll return a bool, whereas this returns Unsafety. I'm going to merge this now as-is, but I can come back and change this later.

@kkysen kkysen merged commit 5d60e87 into master Mar 14, 2026
11 checks passed
@kkysen kkysen deleted the kkysen/transpile-edition-2024 branch March 14, 2026 06:05
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.

#![feature(stdsimd)] was split up and removed in 1.78, so stop emitting it when we upgrade past 1.65

3 participants