@@ -7,7 +7,7 @@ LL | *x = (1,);
77help: consider changing this to be a mutable reference
88 |
99LL | fn named_ref(x: &mut (i32,)) {
10- | ~~~~~~~~~~~
10+ | +++
1111
1212error[E0594]: cannot assign to `x.0`, which is behind a `&` reference
1313 --> $DIR/mutability-errors.rs:10:5
@@ -18,7 +18,7 @@ LL | x.0 = 1;
1818help: consider changing this to be a mutable reference
1919 |
2020LL | fn named_ref(x: &mut (i32,)) {
21- | ~~~~~~~~~~~
21+ | +++
2222
2323error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
2424 --> $DIR/mutability-errors.rs:11:5
@@ -29,7 +29,7 @@ LL | &mut *x;
2929help: consider changing this to be a mutable reference
3030 |
3131LL | fn named_ref(x: &mut (i32,)) {
32- | ~~~~~~~~~~~
32+ | +++
3333
3434error[E0596]: cannot borrow `x.0` as mutable, as it is behind a `&` reference
3535 --> $DIR/mutability-errors.rs:12:5
@@ -40,7 +40,7 @@ LL | &mut x.0;
4040help: consider changing this to be a mutable reference
4141 |
4242LL | fn named_ref(x: &mut (i32,)) {
43- | ~~~~~~~~~~~
43+ | +++
4444
4545error[E0594]: cannot assign to data in a `&` reference
4646 --> $DIR/mutability-errors.rs:16:5
@@ -74,8 +74,8 @@ LL | *x = (1,);
7474 |
7575help: consider changing this to be a mutable pointer
7676 |
77- LL | unsafe fn named_ptr(x: *mut (i32,)) {
78- | ~~~~~~~~~~~
77+ LL | unsafe fn named_ptr(x: *mut const (i32,)) {
78+ | +++
7979
8080error[E0594]: cannot assign to `x.0`, which is behind a `*const` pointer
8181 --> $DIR/mutability-errors.rs:24:5
@@ -85,8 +85,8 @@ LL | (*x).0 = 1;
8585 |
8686help: consider changing this to be a mutable pointer
8787 |
88- LL | unsafe fn named_ptr(x: *mut (i32,)) {
89- | ~~~~~~~~~~~
88+ LL | unsafe fn named_ptr(x: *mut const (i32,)) {
89+ | +++
9090
9191error[E0596]: cannot borrow `*x` as mutable, as it is behind a `*const` pointer
9292 --> $DIR/mutability-errors.rs:25:5
@@ -96,8 +96,8 @@ LL | &mut *x;
9696 |
9797help: consider changing this to be a mutable pointer
9898 |
99- LL | unsafe fn named_ptr(x: *mut (i32,)) {
100- | ~~~~~~~~~~~
99+ LL | unsafe fn named_ptr(x: *mut const (i32,)) {
100+ | +++
101101
102102error[E0596]: cannot borrow `x.0` as mutable, as it is behind a `*const` pointer
103103 --> $DIR/mutability-errors.rs:26:5
@@ -107,8 +107,8 @@ LL | &mut (*x).0;
107107 |
108108help: consider changing this to be a mutable pointer
109109 |
110- LL | unsafe fn named_ptr(x: *mut (i32,)) {
111- | ~~~~~~~~~~~
110+ LL | unsafe fn named_ptr(x: *mut const (i32,)) {
111+ | +++
112112
113113error[E0594]: cannot assign to data in a `*const` pointer
114114 --> $DIR/mutability-errors.rs:30:5
0 commit comments