You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
--> new.rs:56:9
|
56 | EthernetDevice(smoltcp::iface::EthernetInterface::new(device, arp_cache, hardware_addr, ip_addresses))
| ^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'b as defined on the body at 51:38...
--> new.rs:51:39
|
51 | pub fn new(network: File) -> Self {
| _______________________________________^ starting here...
52 | | let device = Box::new(Device { network: network });
53 | | let arp_cache = Box::new(smoltcp::iface::SliceArpCache::new(vec![Default::default(); 8])) as Box<smoltcp::iface::ArpCache>;
54 | | let hardware_addr = smoltcp::wire::EthernetAddress([0x0, 0x0, 0x0, 0x0, 0x0, 0x0]);
55 | | let ip_addresses = [smoltcp::wire::IpAddress::v4(192, 168, 0, 2)];
56 | | EthernetDevice(smoltcp::iface::EthernetInterface::new(device, arp_cache, hardware_addr, ip_addresses))
57 | | }
| |_____^ ...ending here
note: ...so that expression is assignable (expected EthernetDevice<'a, 'b, 'c>, found EthernetDevice<'_, '_, '_>)
--> new.rs:56:9
|
56 | EthernetDevice(smoltcp::iface::EthernetInterface::new(device, arp_cache, hardware_addr, ip_addresses))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: but, the lifetime must be valid for the static lifetime...
note: ...so that the type `smoltcp::iface::Cache` will meet its required lifetime bounds
--> new.rs:56:24
|
56 | EthernetDevice(smoltcp::iface::EthernetInterface::new(device, arp_cache, hardware_addr, ip_addresses))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I know this is not a smoltcp issue, but I have really don't know how to make the compiler happy here, so I was hoping you would be able to suggest something? Or am I trying to do something fundamentally wrong?
The text was updated successfully, but these errors were encountered:
Hi,
I'm trying to wrap
smoltcp::iface::EthernetInterface
like so:This does not work:
I know this is not a
smoltcp
issue, but I have really don't know how to make the compiler happy here, so I was hoping you would be able to suggest something? Or am I trying to do something fundamentally wrong?The text was updated successfully, but these errors were encountered: