Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

Switch to Rust 2021.#953

Merged
eddyb merged 3 commits intoEmbarkStudios:mainfrom
LykenSol:rust2021
Jan 30, 2023
Merged

Switch to Rust 2021.#953
eddyb merged 3 commits intoEmbarkStudios:mainfrom
LykenSol:rust2021

Conversation

@eddyb
Copy link
Copy Markdown
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 marked this pull request as ready for review January 8, 2023 23:12
@eddyb eddyb requested review from VZout, fu5ha 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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants