2021-07-02 16:29:49 +00:00
|
|
|
error[E0594]: cannot assign to `*x`, which is behind a `&` reference
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:9:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
|
|
|
LL | fn named_ref(x: &(i32,)) {
|
2019-04-22 07:40:08 +00:00
|
|
|
| ------- help: consider changing this to be a mutable reference: `&mut (i32,)`
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | *x = (1,);
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2021-07-02 16:29:49 +00:00
|
|
|
error[E0594]: cannot assign to `x.0`, which is behind a `&` reference
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:10:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
|
|
|
LL | fn named_ref(x: &(i32,)) {
|
2019-04-22 07:40:08 +00:00
|
|
|
| ------- help: consider changing this to be a mutable reference: `&mut (i32,)`
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | *x = (1,);
|
|
|
|
LL | x.0 = 1;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
|
|
|
|
--> $DIR/mutability-errors.rs:11:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
|
|
|
LL | fn named_ref(x: &(i32,)) {
|
2019-04-22 07:40:08 +00:00
|
|
|
| ------- help: consider changing this to be a mutable reference: `&mut (i32,)`
|
2018-07-17 19:29:48 +00:00
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut *x;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `x.0` as mutable, as it is behind a `&` reference
|
|
|
|
--> $DIR/mutability-errors.rs:12:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
|
|
|
LL | fn named_ref(x: &(i32,)) {
|
2019-04-22 07:40:08 +00:00
|
|
|
| ------- help: consider changing this to be a mutable reference: `&mut (i32,)`
|
2018-07-17 19:29:48 +00:00
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut x.0;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to data in a `&` reference
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:16:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | *f() = (1,);
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to data in a `&` reference
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:17:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | f().0 = 1;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow data in a `&` reference as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:18:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut *f();
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow data in a `&` reference as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:19:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut f().0;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2021-07-02 16:29:49 +00:00
|
|
|
error[E0594]: cannot assign to `*x`, which is behind a `*const` pointer
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:23:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | unsafe fn named_ptr(x: *const (i32,)) {
|
|
|
|
| ------------- help: consider changing this to be a mutable pointer: `*mut (i32,)`
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | *x = (1,);
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^ `x` is a `*const` pointer, so the data it refers to cannot be written
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2021-07-02 16:29:49 +00:00
|
|
|
error[E0594]: cannot assign to `x.0`, which is behind a `*const` pointer
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:24:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | unsafe fn named_ptr(x: *const (i32,)) {
|
|
|
|
| ------------- help: consider changing this to be a mutable pointer: `*mut (i32,)`
|
|
|
|
LL | *x = (1,);
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | (*x).0 = 1;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^^ `x` is a `*const` pointer, so the data it refers to cannot be written
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `*const` pointer
|
|
|
|
--> $DIR/mutability-errors.rs:25:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | unsafe fn named_ptr(x: *const (i32,)) {
|
|
|
|
| ------------- help: consider changing this to be a mutable pointer: `*mut (i32,)`
|
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut *x;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^ `x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `x.0` as mutable, as it is behind a `*const` pointer
|
|
|
|
--> $DIR/mutability-errors.rs:26:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | unsafe fn named_ptr(x: *const (i32,)) {
|
|
|
|
| ------------- help: consider changing this to be a mutable pointer: `*mut (i32,)`
|
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut (*x).0;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^^^ `x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to data in a `*const` pointer
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:30:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | *f() = (1,);
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to data in a `*const` pointer
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:31:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | (*f()).0 = 1;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow data in a `*const` pointer as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:32:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut *f();
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow data in a `*const` pointer as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:33:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut (*f()).0;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:40:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
|
|
|
|
| - change this to accept `FnMut` instead of `Fn`
|
2020-02-04 00:08:45 +00:00
|
|
|
...
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn_ref(|| {
|
2022-06-27 05:33:19 +00:00
|
|
|
| ------ -- in this closure
|
|
|
|
| |
|
|
|
|
| expects `Fn` instead of `FnMut`
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | x = (1,);
|
|
|
|
| ^^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to `x.0`, as `Fn` closures cannot mutate their captured variables
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:41:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
|
|
|
|
| - change this to accept `FnMut` instead of `Fn`
|
2020-02-04 00:08:45 +00:00
|
|
|
...
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn_ref(|| {
|
2022-06-27 05:33:19 +00:00
|
|
|
| ------ -- in this closure
|
|
|
|
| |
|
|
|
|
| expects `Fn` instead of `FnMut`
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | x = (1,);
|
|
|
|
LL | x.0 = 1;
|
|
|
|
| ^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
|
|
|
|
--> $DIR/mutability-errors.rs:42:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
|
|
|
|
| - change this to accept `FnMut` instead of `Fn`
|
2020-02-04 00:08:45 +00:00
|
|
|
...
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn_ref(|| {
|
2022-06-27 05:33:19 +00:00
|
|
|
| ------ -- in this closure
|
|
|
|
| |
|
|
|
|
| expects `Fn` instead of `FnMut`
|
2022-06-27 05:45:35 +00:00
|
|
|
...
|
|
|
|
LL | &mut x;
|
|
|
|
| ^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `x.0` as mutable, as `Fn` closures cannot mutate their captured variables
|
|
|
|
--> $DIR/mutability-errors.rs:43:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
|
|
|
|
| - change this to accept `FnMut` instead of `Fn`
|
|
|
|
...
|
|
|
|
LL | fn_ref(|| {
|
2022-06-27 05:33:19 +00:00
|
|
|
| ------ -- in this closure
|
|
|
|
| |
|
|
|
|
| expects `Fn` instead of `FnMut`
|
2020-02-04 00:08:45 +00:00
|
|
|
...
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | &mut x.0;
|
|
|
|
| ^^^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:46:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
|
|
|
|
| - change this to accept `FnMut` instead of `Fn`
|
2020-02-04 00:08:45 +00:00
|
|
|
...
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn_ref(move || {
|
2022-06-27 05:33:19 +00:00
|
|
|
| ------ ------- in this closure
|
|
|
|
| |
|
|
|
|
| expects `Fn` instead of `FnMut`
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | x = (1,);
|
|
|
|
| ^^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to `x.0`, as `Fn` closures cannot mutate their captured variables
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:47:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
|
|
|
|
| - change this to accept `FnMut` instead of `Fn`
|
2020-02-04 00:08:45 +00:00
|
|
|
...
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn_ref(move || {
|
2022-06-27 05:33:19 +00:00
|
|
|
| ------ ------- in this closure
|
|
|
|
| |
|
|
|
|
| expects `Fn` instead of `FnMut`
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | x = (1,);
|
|
|
|
LL | x.0 = 1;
|
|
|
|
| ^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
|
|
|
|
--> $DIR/mutability-errors.rs:48:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
|
|
|
|
| - change this to accept `FnMut` instead of `Fn`
|
2020-02-04 00:08:45 +00:00
|
|
|
...
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn_ref(move || {
|
2022-06-27 05:33:19 +00:00
|
|
|
| ------ ------- in this closure
|
|
|
|
| |
|
|
|
|
| expects `Fn` instead of `FnMut`
|
2022-06-27 05:45:35 +00:00
|
|
|
...
|
|
|
|
LL | &mut x;
|
|
|
|
| ^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `x.0` as mutable, as `Fn` closures cannot mutate their captured variables
|
|
|
|
--> $DIR/mutability-errors.rs:49:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
|
|
|
|
| - change this to accept `FnMut` instead of `Fn`
|
|
|
|
...
|
|
|
|
LL | fn_ref(move || {
|
2022-06-27 05:33:19 +00:00
|
|
|
| ------ ------- in this closure
|
|
|
|
| |
|
|
|
|
| expects `Fn` instead of `FnMut`
|
2020-02-04 00:08:45 +00:00
|
|
|
...
|
2022-06-27 05:45:35 +00:00
|
|
|
LL | &mut x.0;
|
|
|
|
| ^^^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:54:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
|
|
|
LL | fn imm_local(x: (i32,)) {
|
2019-04-22 07:40:08 +00:00
|
|
|
| - help: consider changing this to be mutable: `mut x`
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut x;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:55:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
|
|
|
LL | fn imm_local(x: (i32,)) {
|
2019-04-22 07:40:08 +00:00
|
|
|
| - help: consider changing this to be mutable: `mut x`
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut x;
|
|
|
|
LL | &mut x.0;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to `x`, as it is not declared as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:60:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
|
|
|
LL | fn imm_capture(x: (i32,)) {
|
2019-04-22 07:40:08 +00:00
|
|
|
| - help: consider changing this to be mutable: `mut x`
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | || {
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | x = (1,);
|
|
|
|
| ^^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:61:9
|
|
|
|
|
|
|
|
|
LL | fn imm_capture(x: (i32,)) {
|
|
|
|
| - help: consider changing this to be mutable: `mut x`
|
|
|
|
...
|
|
|
|
LL | x.0 = 1;
|
|
|
|
| ^^^^^^^ cannot assign
|
|
|
|
|
|
|
|
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:62:9
|
|
|
|
|
|
|
|
|
LL | fn imm_capture(x: (i32,)) {
|
|
|
|
| - help: consider changing this to be mutable: `mut x`
|
|
|
|
...
|
|
|
|
LL | &mut x;
|
|
|
|
| ^^^^^^ cannot borrow as mutable
|
|
|
|
|
|
|
|
error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:63:9
|
|
|
|
|
|
|
|
|
LL | fn imm_capture(x: (i32,)) {
|
|
|
|
| - help: consider changing this to be mutable: `mut x`
|
|
|
|
...
|
|
|
|
LL | &mut x.0;
|
|
|
|
| ^^^^^^^^ cannot borrow as mutable
|
|
|
|
|
|
|
|
error[E0594]: cannot assign to `x`, as it is not declared as mutable
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:66:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
|
|
|
LL | fn imm_capture(x: (i32,)) {
|
2019-04-22 07:40:08 +00:00
|
|
|
| - help: consider changing this to be mutable: `mut x`
|
2018-07-17 19:29:48 +00:00
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | x = (1,);
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:67:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn imm_capture(x: (i32,)) {
|
|
|
|
| - help: consider changing this to be mutable: `mut x`
|
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | x.0 = 1;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:68:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn imm_capture(x: (i32,)) {
|
|
|
|
| - help: consider changing this to be mutable: `mut x`
|
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut x;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:69:9
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | fn imm_capture(x: (i32,)) {
|
|
|
|
| - help: consider changing this to be mutable: `mut x`
|
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut x.0;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to immutable static item `X`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:76:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | X = (1,);
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0594]: cannot assign to `X.0`, as `X` is an immutable static item
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/mutability-errors.rs:77:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | X.0 = 1;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^ cannot assign
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow immutable static item `X` as mutable
|
|
|
|
--> $DIR/mutability-errors.rs:78:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut X;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error[E0596]: cannot borrow `X.0` as mutable, as `X` is an immutable static item
|
|
|
|
--> $DIR/mutability-errors.rs:79:5
|
2018-07-17 19:29:48 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | &mut X.0;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^ cannot borrow as mutable
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
error: aborting due to 38 previous errors
|
2018-07-17 19:29:48 +00:00
|
|
|
|
2019-11-06 12:58:44 +00:00
|
|
|
Some errors have detailed explanations: E0594, E0596.
|
|
|
|
For more information about an error, try `rustc --explain E0594`.
|