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 86e6cb5 commit 777c7cdCopy full SHA for 777c7cd
clippy_lints/src/new_without_default.rs
@@ -97,14 +97,14 @@ impl<'tcx> LateLintPass<'tcx> for NewWithoutDefault {
97
{
98
if self.impling_types.is_none() {
99
let mut impls = HirIdSet::default();
100
- cx.tcx.for_each_impl(default_trait_id, |d| {
+ for &d in cx.tcx.local_trait_impls(default_trait_id) {
101
let ty = cx.tcx.type_of(d).instantiate_identity();
102
if let Some(ty_def) = ty.ty_adt_def() {
103
if let Some(local_def_id) = ty_def.did().as_local() {
104
impls.insert(cx.tcx.local_def_id_to_hir_id(local_def_id));
105
}
106
107
- });
+ }
108
self.impling_types = Some(impls);
109
110
0 commit comments