Open jieyouxu opened 1 month ago
Great news! I've been doing some MIR work that uses lang items, and ended up just making it work a bit worse instead of dealing with all the no-core tests. If there was a centralized place to deal with problems like this, that'd be great 🎉
Initial test infra PR #130693 has now merged.
Context
We have a bunch of
#![no_core]
ui/codegen/assembly tests that roll their owncore
prelude stubs because they need to build (but not run) on a cross-compiled target. But this means:core
prelude stubs scattered in different tests.Instead of continuing to add more copies of
core
prelude stubs, let's centralize suchcore
prelude stubs into a shared test auxiliary calledminicore
.minicore
is forcore
prelude stubs specifically.std
prelude which can includeliballoc
items and such is beyond the scope ofminicore
, becausecore
is usable by more tests. This does not preclude adding anotherministd
orminialloc
for stubs ofstd
/liballoc
respectively.See https://github.com/rust-lang/rust/issues/130375 for more discussions.
Steps
minicore
test auxiliary.core
stubs only.minicore
.Figure out the logistics on how to absorbcore
stubs intominicore
, then useminicore
to simplify existing#![no_core]
tests.minicore.rs
, it seems like unnecessary churn to also force existing tests to useminicore.rs
atm.Unresolved questions
#![no_core]
tests that could benefit fromminicore
?