Skip to content

Commit c2e66fb

Browse files
committed
clarify error msg for destructuring assignment
1 parent 0c6e631 commit c2e66fb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

source/rust_verify/src/rust_to_vir_expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ pub(crate) fn pattern_to_vir_unadjusted<'tcx>(
507507
) -> Result<vir::ast::Pattern, VirErr> {
508508
let tcx = bctx.ctxt.tcx;
509509
let mut pat_typ = typ_of_node(bctx, pat.span, &pat.hir_id, false)?;
510-
unsupported_err_unless!(pat.default_binding_modes, pat.span, "complex pattern");
510+
unsupported_err_unless!(pat.default_binding_modes, pat.span, "destructuring assignment");
511511
let pattern = match &pat.kind {
512512
PatKind::Wild => PatternX::Wildcard(false),
513513
PatKind::Binding(_binding_mode, canonical, x, subpat) => {

source/rust_verify_test/tests/basic.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,3 +641,13 @@ test_verify_one_file! {
641641
}
642642
} => Ok(())
643643
}
644+
645+
test_verify_one_file! {
646+
#[test] destructuring_assignment_unsupported verus_code! {
647+
fn test() {
648+
let mut a = 0;
649+
let mut b = 0;
650+
(a, b) = (1, 2);
651+
}
652+
} => Err(err) => assert_vir_error_msg(err, "The verifier does not yet support the following Rust feature: destructuring assignment")
653+
}

0 commit comments

Comments
 (0)