blob: 3e23c5f5c7443f96e0a9ca9a1d60f9a09c6a9d44 [file] [log] [blame]
error[E0308]: mismatched types
--> $DIR/dst-bad-coercions.rs:14:17
|
LL | let y: &S = x;
| -- ^ expected `&S`, found *-ptr
| |
| expected due to this
|
= note: expected reference `&S`
found raw pointer `*const S`
error[E0308]: mismatched types
--> $DIR/dst-bad-coercions.rs:15:21
|
LL | let y: &dyn T = x;
| ------ ^
| | |
| | expected `&dyn T`, found *-ptr
| | help: consider borrowing here: `&x`
| expected due to this
|
= note: expected reference `&dyn T`
found raw pointer `*const S`
error[E0308]: mismatched types
--> $DIR/dst-bad-coercions.rs:19:17
|
LL | let y: &S = x;
| -- ^ expected `&S`, found *-ptr
| |
| expected due to this
|
= note: expected reference `&S`
found raw pointer `*mut S`
error[E0308]: mismatched types
--> $DIR/dst-bad-coercions.rs:20:21
|
LL | let y: &dyn T = x;
| ------ ^
| | |
| | expected `&dyn T`, found *-ptr
| | help: consider borrowing here: `&x`
| expected due to this
|
= note: expected reference `&dyn T`
found raw pointer `*mut S`
error[E0308]: mismatched types
--> $DIR/dst-bad-coercions.rs:23:25
|
LL | let x: &mut dyn T = &S;
| ---------- ^^ types differ in mutability
| |
| expected due to this
|
= note: expected mutable reference `&mut dyn T`
found reference `&S`
error[E0308]: mismatched types
--> $DIR/dst-bad-coercions.rs:24:25
|
LL | let x: *mut dyn T = &S;
| ---------- ^^ types differ in mutability
| |
| expected due to this
|
= note: expected raw pointer `*mut dyn T`
found reference `&S`
error[E0308]: mismatched types
--> $DIR/dst-bad-coercions.rs:25:21
|
LL | let x: *mut S = &S;
| ------ ^^ types differ in mutability
| |
| expected due to this
|
= note: expected raw pointer `*mut S`
found reference `&S`
error: aborting due to 7 previous errors
For more information about this error, try `rustc --explain E0308`.