aya-log-ebpf-macros: fix compile errors

aya-log-ebpf-macros was failing to compile because it was referencing
a couple of `DisplayHint` variants that no longer exist. These were
removed in #599.

```
    Compiling aya-log-ebpf-macros v0.1.0 (/home/robert/aya/aya-log-ebpf-macros)
error[E0599]: no variant or associated item named `Ipv4` found for enum `DisplayHint` in the current scope
  --> aya-log-ebpf-macros/src/expand.rs:93:22
   |
93 |         DisplayHint::Ipv4 => parse_str("::aya_log_ebpf::macro_support::check_impl_ipv4"),
   |                      ^^^^ variant or associated item not found in `DisplayHint`

error[E0599]: no variant or associated item named `Ipv6` found for enum `DisplayHint` in the current scope
  --> aya-log-ebpf-macros/src/expand.rs:94:22
   |
94 |         DisplayHint::Ipv6 => parse_str("::aya_log_ebpf::macro_support::check_impl_ipv6"),
   |                      ^^^^ variant or associated item not found in `DisplayHint`

For more information about this error, try `rustc --explain E0599`.
```
pull/615/head
Robert Bartlensky 1 year ago committed by Alessandro Decina
parent 3d1013d729
commit 47a2f25fca

@ -74,12 +74,10 @@ impl_formatter_for_types!(
} }
); );
pub trait Ipv4Formatter {} pub trait IpFormatter {}
impl Ipv4Formatter for u32 {} impl IpFormatter for u32 {}
impl IpFormatter for [u8; 16] {}
pub trait Ipv6Formatter {} impl IpFormatter for [u16; 8] {}
impl Ipv6Formatter for [u8; 16] {}
impl Ipv6Formatter for [u16; 8] {}
pub trait LowerMacFormatter {} pub trait LowerMacFormatter {}
impl LowerMacFormatter for [u8; 6] {} impl LowerMacFormatter for [u8; 6] {}
@ -94,9 +92,7 @@ pub fn check_impl_lower_hex<T: LowerHexFormatter>(_v: T) {}
#[inline(always)] #[inline(always)]
pub fn check_impl_upper_hex<T: UpperHexFormatter>(_v: T) {} pub fn check_impl_upper_hex<T: UpperHexFormatter>(_v: T) {}
#[inline(always)] #[inline(always)]
pub fn check_impl_ipv4<T: Ipv4Formatter>(_v: T) {} pub fn check_impl_ip<T: IpFormatter>(_v: T) {}
#[inline(always)]
pub fn check_impl_ipv6<T: Ipv6Formatter>(_v: T) {}
#[inline(always)] #[inline(always)]
pub fn check_impl_lower_mac<T: LowerMacFormatter>(_v: T) {} pub fn check_impl_lower_mac<T: LowerMacFormatter>(_v: T) {}
#[inline(always)] #[inline(always)]

@ -90,8 +90,7 @@ fn hint_to_format_check(hint: DisplayHint) -> Result<Expr> {
DisplayHint::Default => parse_str("::aya_log_ebpf::macro_support::check_impl_default"), DisplayHint::Default => parse_str("::aya_log_ebpf::macro_support::check_impl_default"),
DisplayHint::LowerHex => parse_str("::aya_log_ebpf::macro_support::check_impl_lower_hex"), DisplayHint::LowerHex => parse_str("::aya_log_ebpf::macro_support::check_impl_lower_hex"),
DisplayHint::UpperHex => parse_str("::aya_log_ebpf::macro_support::check_impl_upper_hex"), DisplayHint::UpperHex => parse_str("::aya_log_ebpf::macro_support::check_impl_upper_hex"),
DisplayHint::Ipv4 => parse_str("::aya_log_ebpf::macro_support::check_impl_ipv4"), DisplayHint::Ip => parse_str("::aya_log_ebpf::macro_support::check_impl_ip"),
DisplayHint::Ipv6 => parse_str("::aya_log_ebpf::macro_support::check_impl_ipv6"),
DisplayHint::LowerMac => parse_str("::aya_log_ebpf::macro_support::check_impl_lower_mac"), DisplayHint::LowerMac => parse_str("::aya_log_ebpf::macro_support::check_impl_lower_mac"),
DisplayHint::UpperMac => parse_str("::aya_log_ebpf::macro_support::check_impl_upper_mac"), DisplayHint::UpperMac => parse_str("::aya_log_ebpf::macro_support::check_impl_upper_mac"),
} }

@ -23,10 +23,10 @@ pub static mut AYA_LOGS: PerfEventByteArray = PerfEventByteArray::new(0);
#[doc(hidden)] #[doc(hidden)]
pub mod macro_support { pub mod macro_support {
pub use aya_log_common::{ pub use aya_log_common::{
check_impl_default, check_impl_ipv4, check_impl_ipv6, check_impl_lower_hex, check_impl_default, check_impl_ip, check_impl_lower_hex, check_impl_lower_mac,
check_impl_lower_mac, check_impl_upper_hex, check_impl_upper_mac, DefaultFormatter, check_impl_upper_hex, check_impl_upper_mac, DefaultFormatter, DisplayHint, IpFormatter,
DisplayHint, Ipv4Formatter, Ipv6Formatter, Level, LowerHexFormatter, LowerMacFormatter, Level, LowerHexFormatter, LowerMacFormatter, UpperHexFormatter, UpperMacFormatter,
UpperHexFormatter, UpperMacFormatter, LOG_BUF_CAPACITY, LOG_BUF_CAPACITY,
}; };
pub use aya_log_ebpf_macros::log; pub use aya_log_ebpf_macros::log;
} }

Loading…
Cancel
Save