Skip to content

Commit 5a8f69b

Browse files
committed
ptr-coercion
1 parent ef026d2 commit 5a8f69b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

tests/ui/coercion/ptr-mutability-errors.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
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:
32
43
//@ dont-require-annotations: NOTE
54

tests/ui/coercion/ptr-mutability-errors.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/ptr-coercion.rs:9:25
2+
--> $DIR/ptr-mutability-errors.rs:8:25
33
|
44
LL | let x: *mut isize = x;
55
| ---------- ^ types differ in mutability
@@ -10,7 +10,7 @@ LL | let x: *mut isize = x;
1010
found raw pointer `*const isize`
1111

1212
error[E0308]: mismatched types
13-
--> $DIR/ptr-coercion.rs:15:25
13+
--> $DIR/ptr-mutability-errors.rs:14:25
1414
|
1515
LL | let x: *mut isize = &42;
1616
| ---------- ^^^ types differ in mutability
@@ -21,7 +21,7 @@ LL | let x: *mut isize = &42;
2121
found reference `&isize`
2222

2323
error[E0308]: mismatched types
24-
--> $DIR/ptr-coercion.rs:21:25
24+
--> $DIR/ptr-mutability-errors.rs:20:25
2525
|
2626
LL | let x: *mut isize = x;
2727
| ---------- ^ types differ in mutability

0 commit comments

Comments
 (0)