gccrs: Resolve unexported items correctly
Fixes resolution of unexported items in gccrs' nr2.0 name resolution phase.
The Rust name resolution (nr2.0) in gccrs has been improved to correctly handle the resolution of unexported items. This change ensures that items not visible outside their module are properly managed, preventing potential resolution errors and maintaining correct program semantics. A test case is included to prevent regressions.
In Details
The nr2.0 name resolution phase in gccrs must correctly distinguish between exported and unexported items. This commit ensures that when an item is unexported, its resolution is appropriately 'closed out' or invalidated if accessed from a context where it shouldn't be visible. This prevents incorrect code generation or type errors stemming from visibility violations.
- gccrs
- The GCC frontend for the Rust programming language, enabling Rust code compilation within the GCC toolchain.
- Name Resolution
- The process by which a compiler determines which declaration a particular use of an identifier refers to. In gccrs, 'nr2.0' likely refers to a specific version or stage of this process.
- Unexported Items
- Declarations (like functions, structs, or variables) within a Rust module that are not made public and thus cannot be accessed from outside that module.