I'm creating a mutable
[u8] buffer as this:
let buffer: &mut [u8] = &mut [0u8; 34];
and using here:
and reborrowing here:
assert_eq!(processor!(iface).process_ip_payload(&mut ip, &mut socket_set, Instant::from_millis(0), &mut *buffer), Ok(Some(expected_repr)));
I learned reorrowing from here: Why my slice gets moved instead of borrowed? and I sucessfully used in some codes. But this one, gives
the size for values of type
[u8]cannot be known at compilation time
doesn't have a size known at compile-time
...,&mut *buffer) reborrow.
The original buffer has its size known. Why reborrowing makes the size unknown?
Here are the signatures if needed:
pub fn emit<T: AsRef<[u8]> + AsMut<[u8]>>( &self, buffer: T, _checksum_caps: &ChecksumCapabilities, ) fn process_ip_payload<'frame, T: AsRef<[u8]>>( &mut self, ip: &mut ip::Processor, sockets: &mut SocketSet, timestamp: Instant, frame: &'frame T, ) -> Result<Option<ip::Packet<'frame>>>