tun2proxy / rust-tun

TUN device creation and handling.
https://docs.rs/tun2/
44 stars 20 forks source link

Apple(iOS) libc::sockaddr_in does not impl Debug trait #62

Closed cavivie closed 5 months ago

cavivie commented 5 months ago

Apple(iOS) libc::sockaddr_in does not impl Debug trait, but tun2 defines SockAddr struct with Debug trait implmentation.

https://github.com/tun2proxy/rust-tun/blob/v2/src/platform/posix/sockaddr.rs#L20

   Compiling tun2 v1.2.8
error[E0277]: `sockaddr_in` doesn't implement `Debug`
  --> .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/tun2-1.2.8/src/platform/posix/sockaddr.rs:21:21
   |
20 | #[derive(Copy, Clone, Debug)]
   |                       ----- in this derive macro expansion
21 | pub struct SockAddr(sockaddr_in);
   |                     ^^^^^^^^^^^ `sockaddr_in` cannot be formatted using `{:?}` because it doesn't implement `Debug`
   |
   = help: the trait `Debug` is not implemented for `sockaddr_in`, which is required by `&sockaddr_in: Debug`
   = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)