Context
We have a bunch of #![no_core] ui/codegen/assembly tests that roll their own core prelude stubs because they need to build (but not run) on a cross-compiled target. But this means:
- A bunch of duplicated implementations of
core prelude stubs scattered in different tests.
- A heavy burden on a contributor of possibly having to update many tests if a new required lang item wants to be added.
- Prelude stubs can obfuscate the intent of the test (more things that the reader has to read and mentally filter out).
Instead of continuing to add more copies of core prelude stubs, let's centralize such core prelude stubs into a shared test auxiliary called minicore. minicore is for core prelude stubs specifically. std prelude which can include liballoc items and such is beyond the scope of minicore, because core is usable by more tests. This does not preclude adding another ministd or minialloc for stubs of std/liballoc respectively.
See #130375 for more discussions.
Steps
Unresolved questions
- What do we do with existing
#![no_core] tests that could benefit from minicore?
Context
We have a bunch of
#![no_core]ui/codegen/assembly tests that roll their owncoreprelude stubs because they need to build (but not run) on a cross-compiled target. But this means:coreprelude stubs scattered in different tests.Instead of continuing to add more copies of
coreprelude stubs, let's centralize suchcoreprelude stubs into a shared test auxiliary calledminicore.minicoreis forcoreprelude stubs specifically.stdprelude which can includeliballocitems and such is beyond the scope ofminicore, becausecoreis usable by more tests. This does not preclude adding anotherministdorminiallocfor stubs ofstd/liballocrespectively.See #130375 for more discussions.
Steps
minicoretest auxiliary.minicorestd/core prelude stubs compiler-team#786corestubs only.minicore.minicoretest auxiliary and support//@ add-core-stubsdirective in ui/assembly/codegen tests #130693minicoretest auxiliary and directive rustc-dev-guide#2097Figure out the logistics on how to absorbcorestubs intominicore, then useminicoreto simplify existing#![no_core]tests.minicore.rs, it seems like unnecessary churn to also force existing tests to useminicore.rsatm.Unresolved questions
#![no_core]tests that could benefit fromminicore?