Run late name resolution on extern crates.
Ensures function return types from extern crates are correctly resolved by enabling late name resolution.
This change modifies gccrs to run the late name resolver on extern crates. Previously, this step was skipped because the content within the functions of extern crates was not directly used. However, function return types are resolved during late name resolution, necessitating its application to extern crates to ensure correct type checking.
In Details
The Session::load_extern_crate function in gccrs now invokes the late name resolver. This is crucial because function return types, which are resolved by the late name resolution pass, may depend on items within extern crates. Skipping this pass for extern crates could lead to unresolved types in function signatures.
- late name resolution
- A phase in Rust compilation where types and other entities are fully resolved after initial parsing and name binding, often catching errors related to function return types and complex trait bounds.
- extern crate
- In Rust, a keyword used to declare that a crate (a compilation unit) is external to the current one and should be made available for use.