You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch fixes multiple ICEs and test failures in the Name Resolution 2.0
- Map directly to definition IDs instead of intermediate import IDs.
- Remove redundant `flatten()` calls. Flattening stripped generic arguments
from aliases like `Self`, causing typecheck errors.
- Prevent ICEs on invalid `use self;` imports by adding early returns.
- Add `Namespace::Types` to pattern lookups to correctly emit E0532 instead
of crashing.
- Remove an unsafe debug loop in `Rib::get` that caused ICEs on ambiguous names.
- Use `value_or` for safe optional unwrapping in module resolution.
gcc/rust/ChangeLog:
* checks/lints/rust-lint-marklive.cc (MarkLive::visit_path_segment): Add Types namespace
lookup.
* checks/lints/unused/rust-unused-checker.cc (UnusedChecker::visit): Use safe optional
unwrapping.
* checks/lints/unused/rust-unused-collector.cc (UnusedCollector::visit): Likewise.
* checks/lints/unused/rust-unused-collector.h: Use helper for multiple namespace lookups.
* resolve/rust-early-name-resolver-2.0.cc (Early::finalize_simple_import): Prevent ICE on
single self imports.
(Early::finalize_rebind_import): Return early to prevent ICE.
* resolve/rust-name-resolution-context.hxx: Use value_or for safe leaf module lookup.
* rust-session-manager.cc (Session::compile_crate): Remove obsolete flatten() calls.
* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Look up enum variants
in Types namespace.
Signed-off-by: Enes Cevik <nsvke@proton.me>
0 commit comments