GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gccrs

gccrs: Fix bad substitution error

Compiler correctly handles substitutions for nested generics.

gccrs has been fixed to correctly handle substitutions involving nested generics, resolving Rust-GCC/gccrs#4884. The changes in rust-type-util.cc, rust-typecheck-context.cc, and rust-tyty-subst.cc ensure that substitutions account for already used arguments in nested generic structures like GenericSplitN< Split <T,P>>. This improves the accuracy of generic type resolution.

In Details

This patch corrects substitution handling for nested generics in gccrs, specifically addressing issues in normalize_projection and UnifyRules::go. It ensures that when substituting arguments for nested generic types (e.g., Outer<Inner<T>>), the adjust call correctly considers previously substituted arguments within the nested structure. This prevents errors caused by misinterpreting the scope and availability of generic parameters in complex nested types.

For Context
Generic substitution
The process of replacing type parameters in a generic definition with specific concrete types or other generic parameters.
Nested generics
Generic types or functions that contain or refer to other generic types or functions within their definitions.
Type substitution
The act of replacing a type placeholder (like a generic type parameter) with an actual type.
Filed Under: gccrsrustgenericstype substitution