We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a3b092 commit bb48688Copy full SHA for bb48688
compiler/rustc_lint/src/non_local_def.rs
@@ -219,7 +219,9 @@ fn path_has_local_parent(
219
impl_parent_parent: Option<DefId>,
220
) -> bool {
221
path.res.opt_def_id().is_some_and(|did| {
222
- let res_parent = cx.tcx.parent(did);
223
- res_parent == impl_parent || Some(res_parent) == impl_parent_parent
+ did.is_local() && {
+ let res_parent = cx.tcx.parent(did);
224
+ res_parent == impl_parent || Some(res_parent) == impl_parent_parent
225
+ }
226
})
227
}
0 commit comments