1
Fork 0

remove has_error_field helper method

This commit is contained in:
lcnr 2023-06-06 09:37:30 +02:00
parent fd9bf59436
commit 01aaad3f1f
5 changed files with 9 additions and 40 deletions

View file

@ -173,18 +173,6 @@ impl<'tcx> TyCtxt<'tcx> {
}
}
pub fn has_error_field(self, ty: Ty<'tcx>) -> bool {
if let ty::Adt(def, substs) = *ty.kind() {
for field in def.all_fields() {
let field_ty = field.ty(self, substs);
if let ty::Error(_) = field_ty.kind() {
return true;
}
}
}
false
}
/// Attempts to returns the deeply last field of nested structures, but
/// does not apply any normalization in its search. Returns the same type
/// if input `ty` is not a structure at all.