aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-01-30 13:27:16 +0000
committerGitHub <noreply@github.com>2023-01-30 13:27:16 +0000
commit026e20b1dcc4765f17d593031fe8c1114e4bfaa5 (patch)
tree48d3a592eaf6b6f77b68bdda4651e8e31962c43a /gcc/rust/parse
parentd7c321da9f8fdee4527285c782db57c7c4d520e4 (diff)
parentd17212591af78ba9894d1ca7aa457ec2340ca461 (diff)
downloadgcc-026e20b1dcc4765f17d593031fe8c1114e4bfaa5.zip
gcc-026e20b1dcc4765f17d593031fe8c1114e4bfaa5.tar.gz
gcc-026e20b1dcc4765f17d593031fe8c1114e4bfaa5.tar.bz2
Merge #1776
1776: fixed compiler error message on wildcard pattern within expression r=CohenArthur a=00AR Signed-off-by: Abdul Rafey <abdulrafeyq@gmail.com> fixed compiler error message on wildcard pattern '_' within expression. Added a new testcase for the same. #867 Co-authored-by: Abdul Rafey <abdulrafeyq@gmail.com>
Diffstat (limited to 'gcc/rust/parse')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 7e4e794..f60d34f 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -13015,6 +13015,12 @@ Parser<ManagedTokenSource>::null_denotation (const_TokenPtr tok,
case UNSAFE:
return parse_unsafe_block_expr (std::move (outer_attrs),
tok->get_locus ());
+ case UNDERSCORE:
+ add_error (
+ Error (tok->get_locus (),
+ "use of %qs is not allowed on the right-side of an assignment",
+ tok->get_token_description ()));
+ return nullptr;
default:
if (!restrictions.expr_can_be_null)
add_error (Error (tok->get_locus (),