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 --- src/test/ui/did_you_mean/issue-39544.stderr | 102 ++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 src/test/ui/did_you_mean/issue-39544.stderr (limited to 'src/test/ui/did_you_mean/issue-39544.stderr') diff --git a/src/test/ui/did_you_mean/issue-39544.stderr b/src/test/ui/did_you_mean/issue-39544.stderr new file mode 100644 index 000000000..68180eaee --- /dev/null +++ b/src/test/ui/did_you_mean/issue-39544.stderr @@ -0,0 +1,102 @@ +error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable + --> $DIR/issue-39544.rs:11:13 + | +LL | let z = Z { x: X::Y }; + | - help: consider changing this to be mutable: `mut z` +LL | let _ = &mut z.x; + | ^^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference + --> $DIR/issue-39544.rs:16:17 + | +LL | fn foo<'z>(&'z self) { + | -------- help: consider changing this to be a mutable reference: `&'z mut self` +LL | let _ = &mut self.x; + | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference + --> $DIR/issue-39544.rs:20:17 + | +LL | fn foo1(&self, other: &Z) { + | ----- help: consider changing this to be a mutable reference: `&mut self` +LL | let _ = &mut self.x; + | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference + --> $DIR/issue-39544.rs:21:17 + | +LL | fn foo1(&self, other: &Z) { + | -- help: consider changing this to be a mutable reference: `&mut Z` +LL | let _ = &mut self.x; +LL | let _ = &mut other.x; + | ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference + --> $DIR/issue-39544.rs:25:17 + | +LL | fn foo2<'a>(&'a self, other: &Z) { + | -------- help: consider changing this to be a mutable reference: `&'a mut self` +LL | let _ = &mut self.x; + | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference + --> $DIR/issue-39544.rs:26:17 + | +LL | fn foo2<'a>(&'a self, other: &Z) { + | -- help: consider changing this to be a mutable reference: `&mut Z` +LL | let _ = &mut self.x; +LL | let _ = &mut other.x; + | ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error[E0596]: cannot borrow `self.x` as mutable, as it is behind a `&` reference + --> $DIR/issue-39544.rs:30:17 + | +LL | fn foo3<'a>(self: &'a Self, other: &Z) { + | -------- help: consider changing this to be a mutable reference: `&'a mut Self` +LL | let _ = &mut self.x; + | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference + --> $DIR/issue-39544.rs:31:17 + | +LL | fn foo3<'a>(self: &'a Self, other: &Z) { + | -- help: consider changing this to be a mutable reference: `&mut Z` +LL | let _ = &mut self.x; +LL | let _ = &mut other.x; + | ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error[E0596]: cannot borrow `other.x` as mutable, as it is behind a `&` reference + --> $DIR/issue-39544.rs:35:17 + | +LL | fn foo4(other: &Z) { + | -- help: consider changing this to be a mutable reference: `&mut Z` +LL | let _ = &mut other.x; + | ^^^^^^^^^^^^ `other` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error[E0596]: cannot borrow `z.x` as mutable, as `z` is not declared as mutable + --> $DIR/issue-39544.rs:41:13 + | +LL | pub fn with_arg(z: Z, w: &Z) { + | - help: consider changing this to be mutable: `mut z` +LL | let _ = &mut z.x; + | ^^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow `w.x` as mutable, as it is behind a `&` reference + --> $DIR/issue-39544.rs:42:13 + | +LL | pub fn with_arg(z: Z, w: &Z) { + | -- help: consider changing this to be a mutable reference: `&mut Z` +LL | let _ = &mut z.x; +LL | let _ = &mut w.x; + | ^^^^^^^^ `w` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error[E0594]: cannot assign to `*x.0`, which is behind a `&` reference + --> $DIR/issue-39544.rs:48:5 + | +LL | *x.0 = 1; + | ^^^^^^^^ cannot assign + +error: aborting due to 12 previous errors + +Some errors have detailed explanations: E0594, E0596. +For more information about an error, try `rustc --explain E0594`. -- cgit v1.2.3