[COMMITTED 003/101] gccrs: Fix error emission for self pointers
arthur.cohen@embecosm.com
arthur.cohen@embecosm.com
Tue Jan 30 12:06:19 GMT 2024
From: Pierre-Emmanuel Patry <pierre-emmanuel.patry@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.patry@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
More information about the Gcc-rust
mailing list