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

Use Spans to detect "system crate"s, for error deferral (zombie) purposes.#952

Merged
eddyb merged 1 commit intoEmbarkStudios:mainfrom
LykenSol:span-based-system-crates
Dec 1, 2022
Merged

Use Spans to detect "system crate"s, for error deferral (zombie) purposes.#952
eddyb merged 1 commit intoEmbarkStudios:mainfrom
LykenSol:span-based-system-crates

Conversation

@eddyb
Copy link
Copy Markdown
Contributor

@eddyb eddyb commented Nov 30, 2022

Before this PR, the distinction between "user code" and "system code" (e.g. core APIs) was based on the crate "doing the codegen", but #[inline]/generic fns (and even macros) can cause e.g. core internals to be codegen'd during the compilation of an user crate.

This used to not be a big issue, because "zombies" (i.e. deferred errors) only get silenced when they're in unused code, so they mostly served to hide errors in e.g. core internals that would not be codegen'd at all, had they had #[inline].

However, we've accumulated several features which rely on hiding various potentially-zombie things (such as the panic entry-point hijacking, or the "unused fn params" weakening), so we need to be using "zombies" (i.e. deferring errors) as much as possible, in order to actually take advantage of that infrastructure.

(I could've gone further and removed is_system_crate, forcing zombie_even_in_user_code's behavior always, but that might lead to confusing outcomes, so I decided against it - for now, anyway)

@eddyb eddyb mentioned this pull request Nov 30, 2022
@eddyb eddyb marked this pull request as ready for review November 30, 2022 17:05
@eddyb eddyb requested a review from oisyn as a code owner November 30, 2022 17:05
@eddyb eddyb enabled auto-merge (rebase) November 30, 2022 17:23
@eddyb eddyb merged commit d000e96 into EmbarkStudios:main Dec 1, 2022
@eddyb eddyb deleted the span-based-system-crates branch December 1, 2022 15:28
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.

2 participants