Skip to content

Commit ae4e108

Browse files
committed
Disallow methods from shadowed traits
1 parent d5880ff commit ae4e108

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc_resolve/resolve_imports.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -743,9 +743,9 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
743743
}
744744
}
745745

746-
// FIXME #31379: We can use methods from imported traits shadowed by non-import items
747-
if !binding.is_import() {
748-
for glob_binding in resolution.duplicate_globs.iter() {
746+
// We can always use methods from the prelude traits
747+
for glob_binding in resolution.duplicate_globs.iter() {
748+
if glob_binding.defined_with(DefModifiers::PRELUDE) {
749749
module.shadowed_traits.borrow_mut().push(glob_binding);
750750
}
751751
}

0 commit comments

Comments
 (0)