rust/src/test/ui/did_you_mean/issue-39544.stderr

103 lines
4.4 KiB
Plaintext
Raw Normal View History

error[E0596]: cannot borrow field `z.x` of immutable binding as mutable
--> $DIR/issue-39544.rs:21:18
|
2018-02-22 18:42:32 -06:00
LL | let z = Z { x: X::Y };
| - help: make this binding mutable: `mut z`
2018-02-22 18:42:32 -06:00
LL | let _ = &mut z.x; //~ ERROR cannot borrow
| ^^^ cannot mutably borrow field of immutable binding
error[E0596]: cannot borrow field `self.x` of immutable binding as mutable
2017-03-26 17:35:50 -05:00
--> $DIR/issue-39544.rs:26:22
|
2018-02-22 18:42:32 -06:00
LL | fn foo<'z>(&'z self) {
2017-03-26 17:35:50 -05:00
| -------- use `&'z mut self` here to make mutable
2018-02-22 18:42:32 -06:00
LL | let _ = &mut self.x; //~ ERROR cannot borrow
| ^^^^^^ cannot mutably borrow field of immutable binding
2017-03-26 17:35:50 -05:00
error[E0596]: cannot borrow field `self.x` of immutable binding as mutable
2017-03-26 17:35:50 -05:00
--> $DIR/issue-39544.rs:30:22
|
2018-02-22 18:42:32 -06:00
LL | fn foo1(&self, other: &Z) {
2017-03-26 17:35:50 -05:00
| ----- use `&mut self` here to make mutable
2018-02-22 18:42:32 -06:00
LL | let _ = &mut self.x; //~ ERROR cannot borrow
| ^^^^^^ cannot mutably borrow field of immutable binding
2017-03-26 17:35:50 -05:00
error[E0596]: cannot borrow field `other.x` of immutable binding as mutable
2017-03-26 17:35:50 -05:00
--> $DIR/issue-39544.rs:31:22
|
2018-02-22 18:42:32 -06:00
LL | fn foo1(&self, other: &Z) {
2017-03-26 17:35:50 -05:00
| -- use `&mut Z` here to make mutable
2018-02-24 17:01:39 -06:00
LL | let _ = &mut self.x; //~ ERROR cannot borrow
2018-02-22 18:42:32 -06:00
LL | let _ = &mut other.x; //~ ERROR cannot borrow
| ^^^^^^^ cannot mutably borrow field of immutable binding
2017-03-26 17:35:50 -05:00
error[E0596]: cannot borrow field `self.x` of immutable binding as mutable
2017-03-26 17:35:50 -05:00
--> $DIR/issue-39544.rs:35:22
|
2018-02-22 18:42:32 -06:00
LL | fn foo2<'a>(&'a self, other: &Z) {
2017-03-26 17:35:50 -05:00
| -------- use `&'a mut self` here to make mutable
2018-02-22 18:42:32 -06:00
LL | let _ = &mut self.x; //~ ERROR cannot borrow
| ^^^^^^ cannot mutably borrow field of immutable binding
2017-03-26 17:35:50 -05:00
error[E0596]: cannot borrow field `other.x` of immutable binding as mutable
2017-03-26 17:35:50 -05:00
--> $DIR/issue-39544.rs:36:22
|
2018-02-22 18:42:32 -06:00
LL | fn foo2<'a>(&'a self, other: &Z) {
2017-03-26 17:35:50 -05:00
| -- use `&mut Z` here to make mutable
2018-02-24 17:01:39 -06:00
LL | let _ = &mut self.x; //~ ERROR cannot borrow
2018-02-22 18:42:32 -06:00
LL | let _ = &mut other.x; //~ ERROR cannot borrow
| ^^^^^^^ cannot mutably borrow field of immutable binding
2017-03-26 17:35:50 -05:00
error[E0596]: cannot borrow field `self.x` of immutable binding as mutable
2017-03-26 17:35:50 -05:00
--> $DIR/issue-39544.rs:40:22
|
2018-02-22 18:42:32 -06:00
LL | fn foo3<'a>(self: &'a Self, other: &Z) {
2017-03-26 17:35:50 -05:00
| -------- use `&'a mut Self` here to make mutable
2018-02-22 18:42:32 -06:00
LL | let _ = &mut self.x; //~ ERROR cannot borrow
| ^^^^^^ cannot mutably borrow field of immutable binding
2017-03-26 17:35:50 -05:00
error[E0596]: cannot borrow field `other.x` of immutable binding as mutable
2017-03-26 17:35:50 -05:00
--> $DIR/issue-39544.rs:41:22
|
2018-02-22 18:42:32 -06:00
LL | fn foo3<'a>(self: &'a Self, other: &Z) {
2017-03-26 17:35:50 -05:00
| -- use `&mut Z` here to make mutable
2018-02-24 17:01:39 -06:00
LL | let _ = &mut self.x; //~ ERROR cannot borrow
2018-02-22 18:42:32 -06:00
LL | let _ = &mut other.x; //~ ERROR cannot borrow
| ^^^^^^^ cannot mutably borrow field of immutable binding
2017-03-26 17:35:50 -05:00
error[E0596]: cannot borrow field `other.x` of immutable binding as mutable
2017-03-26 17:35:50 -05:00
--> $DIR/issue-39544.rs:45:22
|
2018-02-22 18:42:32 -06:00
LL | fn foo4(other: &Z) {
2017-03-26 17:35:50 -05:00
| -- use `&mut Z` here to make mutable
2018-02-22 18:42:32 -06:00
LL | let _ = &mut other.x; //~ ERROR cannot borrow
| ^^^^^^^ cannot mutably borrow field of immutable binding
2017-03-26 17:35:50 -05:00
error[E0596]: cannot borrow field `z.x` of immutable binding as mutable
2017-03-26 17:35:50 -05:00
--> $DIR/issue-39544.rs:51:18
|
2018-02-22 18:42:32 -06:00
LL | pub fn with_arg(z: Z, w: &Z) {
| - help: make this binding mutable: `mut z`
2018-02-22 18:42:32 -06:00
LL | let _ = &mut z.x; //~ ERROR cannot borrow
| ^^^ cannot mutably borrow field of immutable binding
error[E0596]: cannot borrow field `w.x` of immutable binding as mutable
2017-03-26 17:35:50 -05:00
--> $DIR/issue-39544.rs:52:18
|
2018-02-22 18:42:32 -06:00
LL | pub fn with_arg(z: Z, w: &Z) {
| -- use `&mut Z` here to make mutable
2018-02-24 17:01:39 -06:00
LL | let _ = &mut z.x; //~ ERROR cannot borrow
2018-02-22 18:42:32 -06:00
LL | let _ = &mut w.x; //~ ERROR cannot borrow
| ^^^ cannot mutably borrow field of immutable binding
error[E0594]: cannot assign to borrowed content `*x.0` of immutable binding
--> $DIR/issue-39544.rs:58:5
|
2018-02-22 18:42:32 -06:00
LL | *x.0 = 1;
| ^^^^^^^^ cannot borrow as mutable
error: aborting due to 12 previous errors
2018-03-03 08:59:40 -06:00
Some errors occurred: E0594, E0596.
For more information about an error, try `rustc --explain E0594`.