File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
- // Test coercions between pointers which don't do anything fancy like unsizing.
2
- // These are testing that we don't lose mutability when converting to raw pointers.
1
+ //! Tests that pointer coercions preserving mutability are enforced:
3
2
4
3
//@ dont-require-annotations: NOTE
5
4
Original file line number Diff line number Diff line change 1
1
error[E0308]: mismatched types
2
- --> $DIR/ptr-coercion .rs:9 :25
2
+ --> $DIR/ptr-mutability-errors .rs:8 :25
3
3
|
4
4
LL | let x: *mut isize = x;
5
5
| ---------- ^ types differ in mutability
@@ -10,7 +10,7 @@ LL | let x: *mut isize = x;
10
10
found raw pointer `*const isize`
11
11
12
12
error[E0308]: mismatched types
13
- --> $DIR/ptr-coercion .rs:15 :25
13
+ --> $DIR/ptr-mutability-errors .rs:14 :25
14
14
|
15
15
LL | let x: *mut isize = &42;
16
16
| ---------- ^^^ types differ in mutability
@@ -21,7 +21,7 @@ LL | let x: *mut isize = &42;
21
21
found reference `&isize`
22
22
23
23
error[E0308]: mismatched types
24
- --> $DIR/ptr-coercion .rs:21 :25
24
+ --> $DIR/ptr-mutability-errors .rs:20 :25
25
25
|
26
26
LL | let x: *mut isize = x;
27
27
| ---------- ^ types differ in mutability
You can’t perform that action at this time.
0 commit comments