From df0fd3ad845a8514141e180bacf03e19d124a303 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Mon, 7 Jul 2025 13:03:10 +0200 Subject: [PATCH] gccrs: Change enum to enum class 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 --- gcc/rust/parse/rust-parse-impl.h | 6 ++++-- gcc/rust/parse/rust-parse.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 9c9208f9ba4..120817b88b8 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -5604,7 +5604,8 @@ Parser::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::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 diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h index 4fab60ffb08..c9b6edb60e9 100644 --- a/gcc/rust/parse/rust-parse.h +++ b/gcc/rust/parse/rust-parse.h @@ -39,7 +39,7 @@ enum class ParseLoopLabelError NOT_LOOP_LABEL, MISSING_COLON, }; -enum ParseSelfError +enum class ParseSelfError { SELF_PTR, PARSING, -- 2.47.2