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 20200f6 commit 6c4eaddCopy full SHA for 6c4eadd
compiler/rustc_lint/src/non_local_def.rs
@@ -223,7 +223,9 @@ fn path_has_local_parent(
223
impl_parent_parent: Option<DefId>,
224
) -> bool {
225
path.res.opt_def_id().is_some_and(|did| {
226
- let res_parent = cx.tcx.parent(did);
227
- res_parent == impl_parent || Some(res_parent) == impl_parent_parent
+ did.is_local() && {
+ let res_parent = cx.tcx.parent(did);
228
+ res_parent == impl_parent || Some(res_parent) == impl_parent_parent
229
+ }
230
})
231
}
0 commit comments