From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../borrowck-match-binding-is-assignment.stderr | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/test/ui/borrowck/borrowck-match-binding-is-assignment.stderr (limited to 'src/test/ui/borrowck/borrowck-match-binding-is-assignment.stderr') diff --git a/src/test/ui/borrowck/borrowck-match-binding-is-assignment.stderr b/src/test/ui/borrowck/borrowck-match-binding-is-assignment.stderr new file mode 100644 index 000000000..dd22d7e2e --- /dev/null +++ b/src/test/ui/borrowck/borrowck-match-binding-is-assignment.stderr @@ -0,0 +1,58 @@ +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:14:13 + | +LL | x => { + | - + | | + | first assignment to `x` + | help: consider making this binding mutable: `mut x` +LL | x += 1; + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:20:13 + | +LL | E::Foo(x) => { + | - + | | + | first assignment to `x` + | help: consider making this binding mutable: `mut x` +LL | x += 1; + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:26:13 + | +LL | S { bar: x } => { + | - + | | + | first assignment to `x` + | help: consider making this binding mutable: `mut x` +LL | x += 1; + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:32:13 + | +LL | (x,) => { + | - + | | + | first assignment to `x` + | help: consider making this binding mutable: `mut x` +LL | x += 1; + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:38:13 + | +LL | [x,_,_] => { + | - + | | + | first assignment to `x` + | help: consider making this binding mutable: `mut x` +LL | x += 1; + | ^^^^^^ cannot assign twice to immutable variable + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0384`. -- cgit v1.2.3