Skip to content

Conversation

@Polygonalr
Copy link
Contributor

Fixes #3530

This quick fix is kind of an ugly one, since parsing of repr types is not fully implemented yet. This merely adds a new ReprKind type similar to Rust's ReprFlags.

I'm open to suggestions for improvements, or any tips on fully implementing the parsing repr types properly.

Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

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

Just minor style thing and add in another fix please.

@Polygonalr Polygonalr force-pushed the issue-3530 branch 2 times, most recently from 0d46f58 to eb4793e Compare April 3, 2025 23:25
gcc/rust/ChangeLog:

	* typecheck/rust-tyty.h: Add new `ReprKind` enum to
	`ReprOptions`.
	* typecheck/rust-hir-type-check-base.cc: Handle setting of
	`repr_kind`.
	* typecheck/rust-hir-type-check-item.cc: New check for
	zero-variant enums.

Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-base.cc: Set enum representing
	type properly if repr is an integer type.
	* typecheck/rust-hir-type-check-item.cc: Update comments.

Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

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

just minor change to that comment then looks good to go

gcc/rust/ChangeLog:

	* typecheck/rust-tyty.h: Remove extra redundant comment.
	* typecheck/rust-hir-type-check-base.cc: Update comment on repr
	handling.

Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

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

LGTM

@philberty philberty added this pull request to the merge queue Apr 16, 2025
Merged via the queue into Rust-GCC:master with commit a59e57e Apr 16, 2025
12 checks passed
@Polygonalr Polygonalr deleted the issue-3530 branch June 13, 2025 15:00
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.

Unsupported representation on zero-variant enum

2 participants