aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/lex
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-11-15 16:16:01 +0000
committerGitHub <noreply@github.com>2022-11-15 16:16:01 +0000
commit4c565999541c60ac5d1b5af618963e701b384fdd (patch)
treefca6e243cd4901ff8847206ab25ebb5dde10bb91 /gcc/rust/lex
parent815a57351a33491e534cc1b6c6ddfa17eaf2b500 (diff)
parent9657c328d0cdda49b7985c3ee727781a387e128b (diff)
downloadgcc-4c565999541c60ac5d1b5af618963e701b384fdd.zip
gcc-4c565999541c60ac5d1b5af618963e701b384fdd.tar.gz
gcc-4c565999541c60ac5d1b5af618963e701b384fdd.tar.bz2
Merge #1635
1635: rust: Remove unused variables and fix dangling references r=CohenArthur a=CohenArthur This should make the bootstrap build green again. This commit contains some aggressive refactoring which either removes unused arguments altogether or removes the argument name in some cases where it might get used later on or cannot change due to implementing a virtual method or something like that. Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/lex')
-rw-r--r--gcc/rust/lex/rust-lex.cc6
-rw-r--r--gcc/rust/lex/rust-lex.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/gcc/rust/lex/rust-lex.cc b/gcc/rust/lex/rust-lex.cc
index 82949f5..692af5d 100644
--- a/gcc/rust/lex/rust-lex.cc
+++ b/gcc/rust/lex/rust-lex.cc
@@ -1323,7 +1323,7 @@ Lexer::parse_escape (char opening_char)
/* Parses an escape (or string continue) in a string or character. Supports
* unicode escapes. */
std::tuple<Codepoint, int, bool>
-Lexer::parse_utf8_escape (char opening_char)
+Lexer::parse_utf8_escape ()
{
Codepoint output_char;
int additional_length_offset = 0;
@@ -1923,7 +1923,7 @@ Lexer::parse_string (Location loc)
if (current_char32.value == '\\')
{
// parse escape
- auto utf8_escape_pair = parse_utf8_escape ('\'');
+ auto utf8_escape_pair = parse_utf8_escape ();
current_char32 = std::get<0> (utf8_escape_pair);
if (current_char32 == Codepoint (0) && std::get<2> (utf8_escape_pair))
@@ -2324,7 +2324,7 @@ Lexer::parse_char_or_lifetime (Location loc)
if (current_char32.value == '\\')
{
// parse escape
- auto utf8_escape_pair = parse_utf8_escape ('\'');
+ auto utf8_escape_pair = parse_utf8_escape ();
current_char32 = std::get<0> (utf8_escape_pair);
length += std::get<1> (utf8_escape_pair);
diff --git a/gcc/rust/lex/rust-lex.h b/gcc/rust/lex/rust-lex.h
index d5a6c53..27120d1 100644
--- a/gcc/rust/lex/rust-lex.h
+++ b/gcc/rust/lex/rust-lex.h
@@ -108,7 +108,7 @@ private:
std::pair<std::string, int> parse_in_exponent_part ();
std::pair<PrimitiveCoreType, int> parse_in_type_suffix ();
std::tuple<char, int, bool> parse_escape (char opening_char);
- std::tuple<Codepoint, int, bool> parse_utf8_escape (char opening_char);
+ std::tuple<Codepoint, int, bool> parse_utf8_escape ();
int parse_partial_string_continue ();
std::pair<long, int> parse_partial_hex_escape ();
std::pair<Codepoint, int> parse_partial_unicode_escape ();