Skip to content

Commit

Permalink
Fix enum discriminant type
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* backend/rust-compile-type.cc
	(TyTyResolveCompile::get_implicit_enumeral_node_type):
	Make enumeral type equivalent to isize.

Signed-off-by: Owen Avery <[email protected]>
  • Loading branch information
powerboat9 committed Oct 23, 2023
1 parent ee57c0e commit 256188d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gcc/rust/backend/rust-compile-type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ TyTyResolveCompile::get_implicit_enumeral_node_type (Context *ctx)
static tree enum_node = NULL_TREE;
if (enum_node == NULL_TREE)
{
enum_node
= Backend::named_type ("enumeral", Backend::integer_type (false, 64),
BUILTINS_LOCATION);
// equivalent to isize
enum_node = Backend::named_type (
"enumeral", Backend::integer_type (false, Backend::get_pointer_size ()),
BUILTINS_LOCATION);
}
return enum_node;
}
Expand Down

0 comments on commit 256188d

Please sign in to comment.