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

Switch to Rust 2021. #953

Merged
merged 3 commits into from
Jan 30, 2023
Merged

Switch to Rust 2021. #953

merged 3 commits into from
Jan 30, 2023

Conversation

eddyb
Copy link
Contributor

@eddyb eddyb commented Nov 30, 2022

This PR is built on the following PRs: (EDIT: now all of them merged)


Sadly, this is not ready. The big issue here is that Rust 2021 makes panic!("...") go through the same format_args!("...") machinery as everything else (i.e. its special-casing was removed - this means that e.g. panic!("foo: {}") no long bypasses format string checks, and actually errors).

While we should have the ability to ignore such things, there's enough going on that our panic entry-point special-casing (plus the fn param weakening, maybe?) doesn't actually bypass the "zombie" systems enough.

My best guess so far is that, unlike a string literal constant, format_args! actually needs local variables, and the "zombie" system's concept of "dead code" might not include them.

So far my efforts have focused on improving the granularity of the "zombie" system (hence the other PRs), to better debug such failure modes (when I started, it kept pointing at ptr::metadata, which is pretty useless).


EDIT: the new Rust 2021 panic! (which always uses format_args!) is now supported (by removing simple invocations of format_args! feeding directly into a panic entry-point)

@eddyb eddyb force-pushed the rust2021 branch 2 times, most recently from c8e4a37 to 3e880df Compare December 1, 2022 15:30
@eddyb eddyb marked this pull request as ready for review January 8, 2023 23:12
@eddyb eddyb requested review from fu5ha, VZout and oisyn as code owners January 8, 2023 23:12
@eddyb eddyb changed the title [WIP] Switch to Rust 2021. Switch to Rust 2021. Jan 8, 2023
@eddyb eddyb enabled auto-merge (rebase) January 8, 2023 23:14
@eddyb eddyb disabled auto-merge January 9, 2023 06:27
@eddyb eddyb marked this pull request as draft January 9, 2023 06:28
eddyb

This comment was marked as resolved.

@oisyn
Copy link
Contributor

oisyn commented Jan 9, 2023

Oh good point, I also forgot the changelog with the nightly update.

@eddyb eddyb marked this pull request as ready for review January 30, 2023 20:35
@eddyb eddyb enabled auto-merge (rebase) January 30, 2023 20:36
@eddyb eddyb merged commit 2ccdb46 into EmbarkStudios:main Jan 30, 2023
@eddyb eddyb deleted the rust2021 branch January 30, 2023 21:13
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.

3 participants