Skip to content

fix(emit): gate std/alloc injection on loaded crates instead of #![no_std]#14

Open
jakobjung10 wants to merge 1 commit into
zalanlevai:mainfrom
jakobjung10:fix/no-std-injection
Open

fix(emit): gate std/alloc injection on loaded crates instead of #![no_std]#14
jakobjung10 wants to merge 1 commit into
zalanlevai:mainfrom
jakobjung10:fix/no-std-injection

Conversation

@jakobjung10

Copy link
Copy Markdown

The prelude-attr and crate-ref injection decided whether to add std-only features and an extern crate alloc by sniffing for a #![no_std] attribute. That attribute does not reliably survive to this expansion stage (notably during external-mutant recompilation of a no_std crate), so std features were injected into no_std crates and failed to compile.

Check used_crates for the actually-loaded std/alloc crate instead, matching the existing liballoc_internals gate.

…_std]

The prelude-attr and crate-ref injection decided whether to add std-only
features and an `extern crate alloc` by sniffing for a `#![no_std]` attribute.
That attribute does not reliably survive to this expansion stage (notably
during external-mutant recompilation of a no_std crate), so std features were
injected into no_std crates and failed to compile.

Check `used_crates` for the actually-loaded std/alloc crate instead, matching
the existing `liballoc_internals` gate.
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.

1 participant