]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ast: Fix lifetime type parsing
authorJakub Dupak <dev@jakubdupak.com>
Sun, 3 Dec 2023 11:23:17 +0000 (12:23 +0100)
committerCohenArthur <arthur.cohen@embecosm.com>
Wed, 27 Dec 2023 19:03:10 +0000 (19:03 +0000)
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

index 46f00bc1881f6e247a7ed69bca469c7aabe9b110..2d835673545b14dd1b7107ac5c50469bc33f0cb0 100644 (file)
@@ -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);
     }