Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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 alloc crate’s lib.rs file.

  • Prelude Imports: Injected use gccrs_core_prelude::*; across alloc source 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=nameresolution flag.

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.