rust/tests/ui/dst/dst-bad-coercions.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
2.2 KiB
Plaintext
Raw Normal View History

2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2018-12-25 15:56:47 +00:00
--> $DIR/dst-bad-coercions.rs:14:17
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | let y: &S = x;
| -- ^ expected `&S`, found `*const S`
| |
| expected due to this
2018-08-08 12:28:26 +00:00
|
= note: expected reference `&S`
found raw pointer `*const S`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2019-05-28 18:46:13 +00:00
--> $DIR/dst-bad-coercions.rs:15:21
2018-08-08 12:28:26 +00:00
|
2019-05-28 18:46:13 +00:00
LL | let y: &dyn T = x;
| ------ ^ expected `&dyn T`, found `*const S`
| |
| expected due to this
2018-08-08 12:28:26 +00:00
|
= note: expected reference `&dyn T`
found raw pointer `*const S`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2018-12-25 15:56:47 +00:00
--> $DIR/dst-bad-coercions.rs:19:17
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | let y: &S = x;
| -- ^ expected `&S`, found `*mut S`
| |
| expected due to this
2018-08-08 12:28:26 +00:00
|
= note: expected reference `&S`
found raw pointer `*mut S`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2019-05-28 18:46:13 +00:00
--> $DIR/dst-bad-coercions.rs:20:21
2018-08-08 12:28:26 +00:00
|
2019-05-28 18:46:13 +00:00
LL | let y: &dyn T = x;
| ------ ^ expected `&dyn T`, found `*mut S`
| |
| expected due to this
2018-08-08 12:28:26 +00:00
|
= note: expected reference `&dyn T`
found raw pointer `*mut S`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2019-05-28 18:46:13 +00:00
--> $DIR/dst-bad-coercions.rs:23:25
2018-08-08 12:28:26 +00:00
|
2019-05-28 18:46:13 +00:00
LL | let x: &mut dyn T = &S;
| ---------- ^^ types differ in mutability
| |
| expected due to this
2018-08-08 12:28:26 +00:00
|
= note: expected mutable reference `&mut dyn T`
found reference `&S`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2019-05-28 18:46:13 +00:00
--> $DIR/dst-bad-coercions.rs:24:25
2018-08-08 12:28:26 +00:00
|
2019-05-28 18:46:13 +00:00
LL | let x: *mut dyn T = &S;
| ---------- ^^ types differ in mutability
| |
| expected due to this
2018-08-08 12:28:26 +00:00
|
= note: expected raw pointer `*mut dyn T`
found reference `&S`
2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2018-12-25 15:56:47 +00:00
--> $DIR/dst-bad-coercions.rs:25:21
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | let x: *mut S = &S;
| ------ ^^ types differ in mutability
| |
| expected due to this
2018-08-08 12:28:26 +00:00
|
= note: expected raw pointer `*mut S`
found reference `&S`
2018-08-08 12:28:26 +00:00
error: aborting due to 7 previous errors
For more information about this error, try `rustc --explain E0308`.