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