// can't be implemented for unsafe new
return;
}
- if impl_item.generics.params.iter().any(|gen| match gen.kind {
- hir::GenericParamKind::Type { .. } => true,
- _ => false,
- }) {
+ if impl_item
+ .generics
+ .params
+ .iter()
+ .any(|gen| matches!(gen.kind, hir::GenericParamKind::Type { .. }))
+ {
// when the result of `new()` depends on a type parameter we should not require
// an
// impl of `Default`
cx.tcx.for_each_impl(default_trait_id, |d| {
if let Some(ty_def) = cx.tcx.type_of(d).ty_adt_def() {
if let Some(local_def_id) = ty_def.did.as_local() {
- impls.insert(cx.tcx.hir().as_local_hir_id(local_def_id));
+ impls.insert(cx.tcx.hir().local_def_id_to_hir_id(local_def_id));
}
}
});