]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Change enum to enum class
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Mon, 7 Jul 2025 11:03:10 +0000 (13:03 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Aug 2025 14:36:53 +0000 (16:36 +0200)
gcc/rust/ChangeLog:

* parse/rust-parse-impl.h: Add enum prefix.
* parse/rust-parse.h (enum ParseSelfError): Change from enum...
(enum class): To enum class.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/parse/rust-parse-impl.h
gcc/rust/parse/rust-parse.h

index 9c9208f9ba499e2c4317e414fa9627ea07c25b1a..120817b88b8aeeb15902ec3723dc992da558c8f8 100644 (file)
@@ -5604,7 +5604,8 @@ Parser<ManagedTokenSource>::parse_inherent_impl_function_or_method (
   // param
   auto initial_param = parse_self_param ();
 
-  if (!initial_param.has_value () && initial_param.error () != NOT_SELF)
+  if (!initial_param.has_value ()
+      && initial_param.error () != ParseSelfError::NOT_SELF)
     return nullptr;
 
   /* FIXME: ensure that self param doesn't accidently consume tokens for a
@@ -5803,7 +5804,8 @@ Parser<ManagedTokenSource>::parse_trait_impl_function_or_method (
   // param
   auto initial_param = parse_self_param ();
 
-  if (!initial_param.has_value () && initial_param.error () != NOT_SELF)
+  if (!initial_param.has_value ()
+      && initial_param.error () != ParseSelfError::NOT_SELF)
     return nullptr;
 
   // FIXME: ensure that self param doesn't accidently consume tokens for a
index 4fab60ffb080fb1c267b4cc8d26318143e692530..c9b6edb60e9836f2b8ca67d690ae8deac56c5b14 100644 (file)
@@ -39,7 +39,7 @@ enum class ParseLoopLabelError
   NOT_LOOP_LABEL,
   MISSING_COLON,
 };
-enum ParseSelfError
+enum class ParseSelfError
 {
   SELF_PTR,
   PARSING,