rust/tests/ui/traits/upcast_soundness_bug.stderr

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

14 lines
628 B
Plaintext
Raw Normal View History

2024-07-05 22:35:14 +02:00
error[E0308]: mismatched types
2024-02-13 00:17:19 +00:00
--> $DIR/upcast_soundness_bug.rs:59:13
|
LL | let p = p as *const dyn Trait<u8, u16>; // <- this is bad!
2024-07-05 22:35:14 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
2024-02-13 00:17:19 +00:00
|
2024-07-05 22:35:14 +02:00
= note: expected trait object `dyn Trait<u8, u8>`
found trait object `dyn Trait<u8, u16>`
= help: `dyn Trait<u8, u16>` implements `Trait` so you could box the found value and coerce it to the trait object `Box<dyn Trait>`, you will have to change the expected type as well
2024-02-13 00:17:19 +00:00
error: aborting due to 1 previous error
2024-07-05 22:35:14 +02:00
For more information about this error, try `rustc --explain E0308`.