2023-03-20 20:53:43 +00:00
|
|
|
error[E0277]: `&T` needs to have the same ABI as a pointer
|
2024-03-11 01:18:41 +00:00
|
|
|
--> $DIR/check-size-at-cast-polymorphic-bad.rs:15:15
|
2022-11-12 22:27:18 +00:00
|
|
|
|
|
2024-11-20 02:46:56 +00:00
|
|
|
LL | fn polymorphic<T: Debug + ?Sized>(t: &T) {
|
|
|
|
| - this type parameter needs to be `Sized`
|
2022-11-12 22:27:18 +00:00
|
|
|
LL | dyn_debug(t);
|
2023-02-07 18:02:20 +00:00
|
|
|
| ^ `&T` needs to be a pointer-like type
|
2022-11-12 22:27:18 +00:00
|
|
|
|
|
2024-11-20 02:46:56 +00:00
|
|
|
= note: required for `&T` to implement `PointerLike`
|
|
|
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
|
|
|
|
|
|
|
|
LL - fn polymorphic<T: Debug + ?Sized>(t: &T) {
|
|
|
|
LL + fn polymorphic<T: Debug>(t: &T) {
|
2022-11-12 22:27:18 +00:00
|
|
|
|
|
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2022-11-12 22:27:18 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|