aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse
diff options
context:
space:
mode:
authorJakub Dupak <dev@jakubdupak.com>2023-12-03 12:23:17 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-30 12:36:50 +0100
commitc936a63cb7540d0248df645c56d6237553b06991 (patch)
tree7a1490dfdce2b30b9ae444e92f24f5d0e13fb0cf /gcc/rust/parse
parent81fcf1087ccaa83088aaed8b8be9777e66d2465d (diff)
downloadgcc-c936a63cb7540d0248df645c56d6237553b06991.zip
gcc-c936a63cb7540d0248df645c56d6237553b06991.tar.gz
gcc-c936a63cb7540d0248df645c56d6237553b06991.tar.bz2
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>
Diffstat (limited to 'gcc/rust/parse')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 378b9ad..90bc2e2 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);
}