This commit is contained in:
Esteban Küber 2023-11-16 16:42:06 +00:00
parent a519c9b6b7
commit b0d7ccb133

View File

@ -2156,7 +2156,8 @@ fn report_private_fields(
}
}
if let Some(default_trait) = self.tcx.get_diagnostic_item(sym::Default)
&& self.infcx
&& self
.infcx
.type_implements_trait(default_trait, [adt_ty], self.param_env)
.may_apply()
{