[COMMITTED,082/101] gccrs: ast: Fix lifetime type parsing

Message ID 20240130121026.807464-85-arthur.cohen@embecosm.com
State Committed
Commit c936a63cb7540d0248df645c56d6237553b06991
Headers
Series [COMMITTED,001/101] gccrs: Add visibility to trait item |

Commit Message

Arthur Cohen Jan. 30, 2024, 12:07 p.m. UTC
  From: Jakub Dupak <dev@jakubdupak.com>

There was a mismatch whether lifetime 'static is parsed as "static"
or "'static".

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::lifetime_from_token): Fix matched pattern.

Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
---
 gcc/rust/parse/rust-parse-impl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 378b9ada5ed..90bc2e214e4 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -4158,11 +4158,11 @@  Parser<ManagedTokenSource>::lifetime_from_token (const_TokenPtr tok)
   location_t locus = tok->get_locus ();
   std::string lifetime_ident = tok->get_str ();
 
-  if (lifetime_ident == "'static")
+  if (lifetime_ident == "static")
     {
       return AST::Lifetime (AST::Lifetime::STATIC, "", locus);
     }
-  else if (lifetime_ident == "'_")
+  else if (lifetime_ident == "_")
     {
       return AST::Lifetime (AST::Lifetime::WILDCARD, "", locus);
     }