mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
Ensure that restriction paths are ancestors fix: rust-lang/rust#160873 This PR moves the check that `impl` and `mut` restriction paths resolve to ancestor modules from `rustc_resolve` to `rustc_ast_lowering`. This ensures that `RestrictionKind::Restricted` in HIR always refers to an ancestor module. If a restriction path resolves to a non-ancestor, we emit an error and recover by lowering the restriction as `RestrictionKind::Unrestricted`. Tracking Issue: rust-lang/rust#105077 r? @Urgau cc @jhpratt