rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.61k stars 12.74k forks source link

Tracking Issue for minicore (core prelude stubs test auxiliary) #131485

Open jieyouxu opened 1 month ago

jieyouxu commented 1 month ago

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:

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 https://github.com/rust-lang/rust/issues/130375 for more discussions.

Steps

Unresolved questions

scottmcm commented 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 🎉

jieyouxu commented 2 weeks ago

Initial test infra PR #130693 has now merged.