1
Fork 0

Check representation of unnamed fields

This commit is contained in:
Frank King 2024-01-06 18:22:37 +08:00
parent 7d012e8f19
commit 7660d6bf2c
12 changed files with 309 additions and 30 deletions

View file

@ -2216,11 +2216,9 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
// if all of its fields are `Copy` and `Clone`
ty::Adt(adt, args) if adt.is_anonymous() => {
// (*) binder moved here
Where(
obligation
.predicate
.rebind(adt.non_enum_variant().fields.iter().map(|f| f.ty(self.tcx(), args)).collect()),
)
Where(obligation.predicate.rebind(
adt.non_enum_variant().fields.iter().map(|f| f.ty(self.tcx(), args)).collect(),
))
}
ty::Adt(..) | ty::Alias(..) | ty::Param(..) | ty::Placeholder(..) => {