Skip to content

gccrs: Small fixes for #[repr(transparent)]#4716

Merged
CohenArthur merged 1 commit into
Rust-GCC:masterfrom
Polygonalr:repr-transparent-case
Jul 22, 2026
Merged

gccrs: Small fixes for #[repr(transparent)]#4716
CohenArthur merged 1 commit into
Rust-GCC:masterfrom
Polygonalr:repr-transparent-case

Conversation

@Polygonalr

Copy link
Copy Markdown
Contributor

Thanks to @CohenArthur for pointing out the edge case!

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit(StructStruct)): Update
	E0690 error message to use the correct variable for number of fields.
	* typecheck/rust-tyty.cc (ArrayType::is_zero_sized): Catch edge case of array's element
	type being a ZST with capacity is more than 0.

gcc/testsuite/ChangeLog:

	* rust/compile/repr_transparent_fields.rs: Add more test cases.

Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
@Polygonalr
Polygonalr force-pushed the repr-transparent-case branch from 17c7e26 to d087c7c Compare July 22, 2026 01:37

@CohenArthur CohenArthur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :D

@CohenArthur
CohenArthur added this pull request to the merge queue Jul 22, 2026
Merged via the queue into Rust-GCC:master with commit a29a82e Jul 22, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants