Those ranges were looking for a curly brace after the brace, leading
to an error when using range from expr in for loops.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_expr): Fix range from expr.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
/* DO NOT INCLUDE ANYWHERE - this is automatically included with rust-parse.h
* This is also the reason why there are no include guards. */
+#include "rust-token.h"
#define INCLUDE_ALGORITHM
#include "rust-diagnostics.h"
#include "rust-make-unique.h"
{
TokenId id = current_token->get_id ();
if (id == SEMICOLON || id == RIGHT_PAREN || id == RIGHT_CURLY
- || id == RIGHT_SQUARE || id == COMMA)
+ || id == RIGHT_SQUARE || id == COMMA || id == LEFT_CURLY)
return nullptr;
}