@@ -7,7 +7,7 @@ LL | *x = (1,);
7
7
help: consider changing this to be a mutable reference
8
8
|
9
9
LL | fn named_ref(x: &mut (i32,)) {
10
- | ~~~~~~~~~~~
10
+ | +++
11
11
12
12
error[E0594]: cannot assign to `x.0`, which is behind a `&` reference
13
13
--> $DIR/mutability-errors.rs:10:5
@@ -18,7 +18,7 @@ LL | x.0 = 1;
18
18
help: consider changing this to be a mutable reference
19
19
|
20
20
LL | fn named_ref(x: &mut (i32,)) {
21
- | ~~~~~~~~~~~
21
+ | +++
22
22
23
23
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
24
24
--> $DIR/mutability-errors.rs:11:5
@@ -29,7 +29,7 @@ LL | &mut *x;
29
29
help: consider changing this to be a mutable reference
30
30
|
31
31
LL | fn named_ref(x: &mut (i32,)) {
32
- | ~~~~~~~~~~~
32
+ | +++
33
33
34
34
error[E0596]: cannot borrow `x.0` as mutable, as it is behind a `&` reference
35
35
--> $DIR/mutability-errors.rs:12:5
@@ -40,7 +40,7 @@ LL | &mut x.0;
40
40
help: consider changing this to be a mutable reference
41
41
|
42
42
LL | fn named_ref(x: &mut (i32,)) {
43
- | ~~~~~~~~~~~
43
+ | +++
44
44
45
45
error[E0594]: cannot assign to data in a `&` reference
46
46
--> $DIR/mutability-errors.rs:16:5
@@ -74,8 +74,8 @@ LL | *x = (1,);
74
74
|
75
75
help: consider changing this to be a mutable pointer
76
76
|
77
- LL | unsafe fn named_ptr(x: *mut (i32,)) {
78
- | ~~~~~~~~~~~
77
+ LL | unsafe fn named_ptr(x: *mut const (i32,)) {
78
+ | +++
79
79
80
80
error[E0594]: cannot assign to `x.0`, which is behind a `*const` pointer
81
81
--> $DIR/mutability-errors.rs:24:5
@@ -85,8 +85,8 @@ LL | (*x).0 = 1;
85
85
|
86
86
help: consider changing this to be a mutable pointer
87
87
|
88
- LL | unsafe fn named_ptr(x: *mut (i32,)) {
89
- | ~~~~~~~~~~~
88
+ LL | unsafe fn named_ptr(x: *mut const (i32,)) {
89
+ | +++
90
90
91
91
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `*const` pointer
92
92
--> $DIR/mutability-errors.rs:25:5
@@ -96,8 +96,8 @@ LL | &mut *x;
96
96
|
97
97
help: consider changing this to be a mutable pointer
98
98
|
99
- LL | unsafe fn named_ptr(x: *mut (i32,)) {
100
- | ~~~~~~~~~~~
99
+ LL | unsafe fn named_ptr(x: *mut const (i32,)) {
100
+ | +++
101
101
102
102
error[E0596]: cannot borrow `x.0` as mutable, as it is behind a `*const` pointer
103
103
--> $DIR/mutability-errors.rs:26:5
@@ -107,8 +107,8 @@ LL | &mut (*x).0;
107
107
|
108
108
help: consider changing this to be a mutable pointer
109
109
|
110
- LL | unsafe fn named_ptr(x: *mut (i32,)) {
111
- | ~~~~~~~~~~~
110
+ LL | unsafe fn named_ptr(x: *mut const (i32,)) {
111
+ | +++
112
112
113
113
error[E0594]: cannot assign to data in a `*const` pointer
114
114
--> $DIR/mutability-errors.rs:30:5
0 commit comments