GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gccrs

gccrs: Ensure function node links are unnamed

Modifies gccrs to prevent function nodes from being used as named links, enhancing name resolution accuracy.

This change prevents function nodes in gccrs from being treated as named links during name resolution. By ensuring that function names are not passed as path parameters in NameResolutionContext::scoped, the compiler avoids potential ambiguities and incorrect linking. A new test, mod_fn_conflict.rs, is added to confirm this behavior.

In Details

In rust-default-resolver.cc, the DefaultResolver::visit(Function) method previously passed a path parameter to NameResolutionContext::scoped when resolving function nodes. This commit corrects this by omitting the path parameter, ensuring that function nodes are not treated as linkable entities with names, aligning with Rust's semantics and preventing potential name resolution conflicts.

For Context
name resolution
The process by which a compiler or interpreter determines which declaration a particular identifier refers to. This is crucial for correctly understanding and processing code.
node links
In the context of compiler internal representations, 'node links' likely refers to references or connections between different nodes in an Abstract Syntax Tree (AST) or similar structure, allowing traversal and manipulation of the code's structure.
AST
Abstract Syntax Tree. A tree representation of the abstract syntactic structure of source code, where each node represents a construct occurring in the source code.
Filed Under: gccrsrustname resolutioncompiler internals