1
Fork 0

check uniqueness of nested fields

This commit is contained in:
Frank King 2024-01-04 21:56:45 +08:00
parent 879a1e5713
commit 36d7e7fd3f
12 changed files with 1842 additions and 97 deletions

View file

@ -401,7 +401,7 @@ impl<'tcx> AdtDef<'tcx> {
}
/// Returns an iterator over all fields contained
/// by this ADT.
/// by this ADT (nested unnamed fields are not expanded).
#[inline]
pub fn all_fields(self) -> impl Iterator<Item = &'tcx FieldDef> + Clone {
self.variants().iter().flat_map(|v| v.fields.iter())