]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Tue, 21 Nov 2023 09:19:08 +0000 (09:19 +0000)
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 17a4f7e5accaa5259351f4cdbc29ffe14d9a62ba..eb5278232f47c2246cd27f3d2d1bbabe6114a401 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 ())