aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2023-01-26 22:48:45 -0500
committerCohenArthur <arthur.cohen@embecosm.com>2023-02-20 09:29:04 +0000
commit0f736eb625903c15415fa3835b88c76219e4ce78 (patch)
tree23925646a939e09f90e1b697e2d90f2d71475827 /gcc
parent1774ff486a3352c52e4faa9a9096bac43d675a4e (diff)
downloadgcc-0f736eb625903c15415fa3835b88c76219e4ce78.zip
gcc-0f736eb625903c15415fa3835b88c76219e4ce78.tar.gz
gcc-0f736eb625903c15415fa3835b88c76219e4ce78.tar.bz2
Address unsafe with/without block handling ambiguity
gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_expr_stmt): Remove hypothetical unsafe + expr_stmt_without_block handling. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 6a98bcc..1e5b2dc 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -7188,18 +7188,9 @@ Parser<ManagedTokenSource>::parse_expr_stmt (AST::AttrVec outer_attrs,
}
}
case UNSAFE: {
- /* FIXME: are there any expressions without blocks that can have
- * unsafe as their first token? Or is unsafe the only one? */
- // safe side for now
- if (lexer.peek_token (1)->get_id () == LEFT_CURLY)
- {
- return parse_expr_stmt_with_block (std::move (outer_attrs));
- }
- else
- {
- return parse_expr_stmt_without_block (std::move (outer_attrs),
- restrictions);
- }
+ // unsafe block
+ // https://doc.rust-lang.org/reference/unsafe-keyword.html
+ return parse_expr_stmt_with_block (std::move (outer_attrs));
}
default:
// not a parse expr with block, so must be expr without block