1
Fork 0

Rollup merge of #138296 - compiler-errors:deanonymous, r=lcnr

Remove `AdtFlags::IS_ANONYMOUS` and `Copy`/`Clone` condition for anonymous ADT

cc #131045, which removed anonymous ADTs from the compiler

I forgot more stuff I guess.
This commit is contained in:
Matthias Krüger 2025-03-11 19:35:33 +01:00 committed by GitHub
commit 954b88ed2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1 additions and 18 deletions

View file

@ -2231,15 +2231,6 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
}
}
// `Copy` and `Clone` are automatically implemented for an anonymous adt
// 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(),
))
}
ty::Adt(..) | ty::Alias(..) | ty::Param(..) | ty::Placeholder(..) => {
// Fallback to whatever user-defined impls exist in this case.
None