aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-10-09 13:06:22 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 19:09:11 +0100
commit80199b328cbc7efedf0d88a8cdceccedd1b6c355 (patch)
tree5030ca504b136164472d99ca5088c3766d0043c7 /gcc
parent44f71ed313d03e129dcb9d34720425245a384050 (diff)
downloadgcc-80199b328cbc7efedf0d88a8cdceccedd1b6c355.zip
gcc-80199b328cbc7efedf0d88a8cdceccedd1b6c355.tar.gz
gcc-80199b328cbc7efedf0d88a8cdceccedd1b6c355.tar.bz2
gccrs: Change debug log call to as_string function
This will ensure an accurate representation of the token. Also update the as_string function to represent accurately scope resolution tokens. gcc/rust/ChangeLog: * lex/rust-token.cc (Token::as_string): Update function to output scope resolution tokens correctly. * parse/rust-parse-impl.h (Parser::parse_generic_param): Change call to as_string. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/lex/rust-token.cc2
-rw-r--r--gcc/rust/parse/rust-parse-impl.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/gcc/rust/lex/rust-token.cc b/gcc/rust/lex/rust-token.cc
index 868946f..ea35505 100644
--- a/gcc/rust/lex/rust-token.cc
+++ b/gcc/rust/lex/rust-token.cc
@@ -245,6 +245,8 @@ Token::as_string () const
return "b'" + escape_special_chars (get_str (), Context::Char) + "'";
case LIFETIME:
return "'" + get_str ();
+ case SCOPE_RESOLUTION:
+ return "::";
case INT_LITERAL:
if (get_type_hint () == CORETYPE_UNKNOWN)
return get_str ();
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 214a7ee..7f47085 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -3093,7 +3093,7 @@ Parser<ManagedTokenSource>::parse_generic_param (EndTokenPred is_end_token)
// FIXME: Can we clean this last call with a method call?
rust_error_at (token->get_locus (),
"unexpected token when parsing generic parameters: %qs",
- token->get_str ().c_str ());
+ token->as_string ().c_str ());
return nullptr;
}