Skip to content

Commit

Permalink
Fix error emission for self pointers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
P-E-P committed Nov 15, 2023
1 parent fe0d34c commit 122ffbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gcc/rust/parse/rust-parse-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7125,7 +7125,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 ())
Expand Down

0 comments on commit 122ffbe

Please sign in to comment.