Skip to content

Commit cc6888d

Browse files
Don't consider RibKind::Module's bindings when checking generics shadowing
1 parent c6f81a4 commit cc6888d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_resolve/src/late.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2677,14 +2677,14 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
26772677
// We also can't shadow bindings from associated parent items.
26782678
for ns in [ValueNS, TypeNS] {
26792679
for parent_rib in self.ribs[ns].iter().rev() {
2680-
seen_bindings
2681-
.extend(parent_rib.bindings.keys().map(|ident| (*ident, ident.span)));
2682-
26832680
// Break at mod level, to account for nested items which are
26842681
// allowed to shadow generic param names.
26852682
if matches!(parent_rib.kind, RibKind::Module(..)) {
26862683
break;
26872684
}
2685+
2686+
seen_bindings
2687+
.extend(parent_rib.bindings.keys().map(|ident| (*ident, ident.span)));
26882688
}
26892689
}
26902690

0 commit comments

Comments
 (0)