We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8df3e4e commit 5d477fbCopy full SHA for 5d477fb
compiler/rustc_lint/src/non_local_def.rs
@@ -175,17 +175,18 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions {
175
| TyKind::Err(_) => false,
176
};
177
178
- let of_trait_has_local_parent = impl_
179
- .of_trait
180
- .map(|of_trait| {
181
- path_has_local_parent(
182
- of_trait.path,
183
- cx,
184
- &mut parent_owner,
185
- &mut extra_local_parent,
186
- )
187
- })
188
- .unwrap_or(false);
+ let of_trait_has_local_parent = self_ty_has_local_parent
+ || impl_
+ .of_trait
+ .map(|of_trait| {
+ path_has_local_parent(
+ of_trait.path,
+ cx,
+ &mut parent_owner,
+ &mut extra_local_parent,
+ )
+ })
189
+ .unwrap_or(false);
190
191
// If none of them have a local parent (LOGICAL NOR) this means that
192
// this impl definition is a non-local definition and so we lint on it.
0 commit comments