Esteban Küber
41fede0c0b
Tweak dyn compatibility error when pointing at receiver
Account for receivers with arbitrary self types to suggest idiomatic code.
```
error[E0038]: the trait `Fetcher` is not dyn compatible
--> $DIR/undispatchable-receiver-and-wc-references-Self.rs:19:21
|
LL | fn fetcher() -> Box<dyn Fetcher> {
| ^^^^^^^^^^^ `Fetcher` is not dyn compatible
|
note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
--> $DIR/undispatchable-receiver-and-wc-references-Self.rs:11:16
|
LL | pub trait Fetcher: Send + Sync {
| ------- this trait is not dyn compatible...
LL | fn get<'a>(self: &'a Box<Self>) -> Pin<Box<dyn Future<Output = Vec<u8>> + 'a>>
| ^^^^^^^^^^^^^^^^^^^ ...because method `get`'s `self` parameter cannot be dispatched on
help: consider changing method `get`'s `self` parameter to be `&self`
|
LL - fn get<'a>(self: &'a Box<Self>) -> Pin<Box<dyn Future<Output = Vec<u8>> + 'a>>
LL + fn get<'a>(&'a self) -> Pin<Box<dyn Future<Output = Vec<u8>> + 'a>>
|
```
Instead of
```
help: consider changing method `get`'s `self` parameter to be `&self`
|
LL - fn get<'a>(self: &'a Box<Self>) -> Pin<Box<dyn Future<Output = Vec<u8>> + 'a>>
LL + fn get<'a>(self: &Self) -> Pin<Box<dyn Future<Output = Vec<u8>> + 'a>>
|
```
2026-09-21 18:52:54 +00:00
..
2025-05-26 10:57:54 +00:00
2025-05-27 08:18:11 +00:00
2026-02-18 18:33:35 +00:00
2026-09-20 17:36:00 +00:00
2026-02-18 18:33:35 +00:00
2025-10-15 09:35:05 +01:00
2026-09-20 17:36:00 +00:00
2026-02-18 18:33:35 +00:00
2025-05-26 10:57:54 +00:00
2026-03-17 01:52:28 +01:00
2025-03-14 21:03:21 +00:00
2025-08-19 21:27:10 +02:00
2025-03-14 21:03:21 +00:00
2026-08-22 17:49:34 +05:30
2025-08-19 21:27:10 +02:00
2025-07-16 01:44:02 -07:00
2026-04-28 23:10:46 +02:00
2026-01-21 12:53:47 +01:00
2025-08-04 16:43:53 -04:00
2025-08-04 16:43:53 -04:00
2026-06-06 21:02:15 +02:00
2026-08-22 17:49:34 +05:30
2026-06-03 19:33:57 +02:00
2026-06-03 19:33:57 +02:00
2025-12-02 18:25:13 +00:00
2026-01-21 12:53:44 +01:00
2025-05-26 10:57:54 +00:00
2025-05-27 08:18:11 +00:00
2026-08-13 11:44:34 +08:00
2026-08-13 11:44:34 +08:00
2025-05-26 10:57:54 +00:00
2025-05-27 08:18:11 +00:00
2025-05-26 10:57:54 +00:00
2025-05-26 10:57:54 +00:00
2026-01-20 12:54:40 -06:00
2026-06-16 21:59:19 +01:00
2026-06-16 21:59:19 +01:00
2026-01-21 12:53:44 +01:00
2025-11-21 23:03:39 +09:00
2026-01-21 12:53:44 +01:00
2025-05-26 10:57:54 +00:00
2026-08-22 17:49:34 +05:30
2026-04-28 23:10:46 +02:00
2026-01-20 12:54:40 -06:00
2025-06-24 18:59:42 +00:00
2026-02-18 18:33:35 +00:00
2025-05-26 10:57:54 +00:00
2025-05-26 10:57:54 +00:00
2026-01-20 12:54:40 -06:00
2026-01-20 12:54:40 -06:00
2025-05-26 10:57:54 +00:00
2025-05-26 10:57:54 +00:00
2025-11-27 11:19:00 -05:00
2026-08-22 17:49:34 +05:30
2026-08-22 17:49:34 +05:30
2026-08-22 17:49:34 +05:30
2025-06-13 13:54:06 +00:00
2026-01-21 12:53:44 +01:00
2026-06-23 00:51:39 +02:00
2026-06-23 00:51:39 +02:00
2025-07-25 23:39:26 +00:00
2026-08-22 17:49:34 +05:30
2026-01-21 12:53:47 +01:00
2026-01-21 12:53:47 +01:00
2025-05-23 12:20:35 +00:00
2026-09-21 18:52:54 +00:00
2026-04-07 23:42:36 +08:00
2026-09-21 18:52:54 +00:00