Commit Graph

9 Commits

Author SHA1 Message Date
David Wood
4e03c51f7d
hir_analysis: enums return None in find_field
Unnamed union fields with enums are checked for, but if `find_field`
causes an ICE then the compiler won't get to that point.

Signed-off-by: David Wood <david@davidtw.co>
2024-03-04 11:38:16 +00:00
clubby789
35a9e73521 Don't ICE on anonymous struct in enum variant 2024-02-23 12:25:23 +00:00
clubby789
62b789fba4 Add more checks for unnamed_field during HIR analysis 2024-02-17 15:12:33 +00:00
Frank King
0dbd6e9572 Improve some codes according to the reviews
- improve diagnostics of field uniqueness check and representation check
- simplify the implementation of field uniqueness check
- remove some useless codes and improvement neatness
2024-02-12 12:47:32 +08:00
Frank King
2b04ca94bb Add #[derive(Clone, Copy)] to anonymous adts
Fix the `AssertBoundIsClone` error for anonymous adts.
2024-02-12 12:47:32 +08:00
Frank King
7660d6bf2c Check representation of unnamed fields 2024-02-12 12:47:31 +08:00
Frank King
36d7e7fd3f check uniqueness of nested fields 2024-02-12 12:47:29 +08:00
Frank King
879a1e5713 Lower anonymous structs or unions to HIR 2024-02-12 12:47:23 +08:00
Frank King
868706d9b5 Parse unnamed fields and anonymous structs or unions
Anonymous structs or unions are only allowed in struct field
definitions.

Co-authored-by: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com>
2023-08-24 11:17:54 +08:00