From: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>

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.pa...@embecosm.com>
---
 gcc/rust/parse/rust-parse-impl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 0ae89dc3907..1ebe1ed442c 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -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 ())
-- 
2.42.1

Reply via email to