gccrs#4693: Add the alloc crate to the testsuite
Link: Rust-GCC/gccrs#4693
Note
This is important
Objective
This PR introduces the alloc crate to the compiler’s automated test suite. To achieve a clean compilation baseline, a few source-level workarounds were applied to bypass current compiler limitations.
Changes Made
-
Mock Core Integration: Embedded a primitive “mock core” as a submodule directly within the
alloccrate’slib.rsfile. -
Prelude Imports: Injected
use gccrs_core_prelude::*;acrossallocsource files to ensure they can successfully resolve the mock core items. -
Test Runner Configuration: Configured the test suite to compile the crate up to the name resolution phase using the
-frust-compile-until=nameresolutionflag.
Why is this needed for alloc?
Integrating alloc into the automated test suite locks in the progress made. It provides a strict baseline that prevents future compiler modifications from silently breaking alloc compatibility.
Known Restrictions & Future Work
Currently, the alloc test suite must be kept synchronized with the core test suite. Our mock core is minimal but gccrs still lacks complete upstream core support so the alloc crate can only be compiled up to the name resolution phase.
These temporary source-level workarounds and phase limitations will be incrementally removed as gccrs matures and gains full core support.