aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
authorAbdul Rafey <abdulrafeyq@gmail.com>2023-01-29 17:05:23 +0530
committerAbdul Rafey <abdulrafeyq@gmail.com>2023-01-30 16:15:50 +0530
commitd17212591af78ba9894d1ca7aa457ec2340ca461 (patch)
tree739c431556dc0622df1af89564911fcc0c254d25 /gcc/rust/parse/rust-parse-impl.h
parentd12a38da686e39952e083821f1d77116f3ed91af (diff)
downloadgcc-d17212591af78ba9894d1ca7aa457ec2340ca461.zip
gcc-d17212591af78ba9894d1ca7aa457ec2340ca461.tar.gz
gcc-d17212591af78ba9894d1ca7aa457ec2340ca461.tar.bz2
fixed compiler error message on wildcard pattern within expression
Signed-off-by: Abdul Rafey <abdulrafeyq@gmail.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-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 c19fe9b..17ca6bb 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -13021,6 +13021,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 (),