[gcc r14-8606] gccrs: ast: Fix lifetime type parsing
Arthur Cohen
cohenarthur@gcc.gnu.org
Tue Jan 30 12:01:16 GMT 2024
https://gcc.gnu.org/g:c936a63cb7540d0248df645c56d6237553b06991
commit r14-8606-gc936a63cb7540d0248df645c56d6237553b06991
Author: Jakub Dupak <dev@jakubdupak.com>
Date: Sun Dec 3 12:23:17 2023 +0100
gccrs: ast: Fix lifetime type parsing
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>
Diff:
---
gcc/rust/parse/rust-parse-impl.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 378b9ada5ed1..90bc2e214e47 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);
}
More information about the Gcc-cvs
mailing list