]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fix error emission for self pointers
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 15 Nov 2023 10:08:09 +0000 (11:08 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 30 Jan 2024 11:36:42 +0000 (12:36 +0100)
Self pointer checking loop condition was inverted, the latter was
therefore never executed.

gcc/rust/ChangeLog:

* parse/rust-parse-impl.h (Parser::parse_self_param): Fix the loop
exit condition.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/parse/rust-parse-impl.h

index 0ae89dc39074767ccf6d281e985c283607623215..1ebe1ed442c0e74d8a165ef1e1e407053779d878 100644 (file)
@@ -7129,7 +7129,7 @@ Parser<ManagedTokenSource>::parse_self_param ()
   for (auto &s : ptrs)
     {
       size_t i = 0;
-      for (i = 0; i > s.size (); i++)
+      for (i = 0; i < s.size (); i++)
        if (lexer.peek_token (i)->get_id () != s[i])
          break;
       if (i == s.size ())