Skip to content

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

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

Merged
merged 1 commit into from
Dec 1, 2022
Merged

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

merged 1 commit into from
Dec 1, 2022

Conversation

eddyb
Copy link
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 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.

2 participants