rust/src/test/ui/dst/dst-bad-coercions.stderr

73 lines
2.0 KiB
Plaintext
Raw Normal View History

2018-08-08 07:28:26 -05:00
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/dst-bad-coercions.rs:14:17
2018-08-08 07:28:26 -05:00
|
LL | let y: &S = x; //~ ERROR mismatched types
| ^ expected &S, found *-ptr
|
= note: expected type `&S`
found type `*const S`
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/dst-bad-coercions.rs:15:17
2018-08-08 07:28:26 -05:00
|
LL | let y: &T = x; //~ ERROR mismatched types
| ^
| |
| expected &dyn T, found *-ptr
| help: consider borrowing here: `&x`
|
= note: expected type `&dyn T`
found type `*const S`
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/dst-bad-coercions.rs:19:17
2018-08-08 07:28:26 -05:00
|
LL | let y: &S = x; //~ ERROR mismatched types
| ^ expected &S, found *-ptr
|
= note: expected type `&S`
found type `*mut S`
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/dst-bad-coercions.rs:20:17
2018-08-08 07:28:26 -05:00
|
LL | let y: &T = x; //~ ERROR mismatched types
| ^
| |
| expected &dyn T, found *-ptr
| help: consider borrowing here: `&x`
|
= note: expected type `&dyn T`
found type `*mut S`
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/dst-bad-coercions.rs:23:21
2018-08-08 07:28:26 -05:00
|
LL | let x: &mut T = &S; //~ ERROR mismatched types
| ^^ types differ in mutability
|
= note: expected type `&mut dyn T`
found type `&S`
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/dst-bad-coercions.rs:24:21
2018-08-08 07:28:26 -05:00
|
LL | let x: *mut T = &S; //~ ERROR mismatched types
| ^^ types differ in mutability
|
= note: expected type `*mut dyn T`
found type `&S`
error[E0308]: mismatched types
2018-12-25 09:56:47 -06:00
--> $DIR/dst-bad-coercions.rs:25:21
2018-08-08 07:28:26 -05:00
|
LL | let x: *mut S = &S; //~ ERROR mismatched types
| ^^ types differ in mutability
|
= note: expected type `*mut S`
found type `&S`
error: aborting due to 7 previous errors
For more information about this error, try `rustc --explain E0308`.