diff --git a/aya-log-parser/src/lib.rs b/aya-log-parser/src/lib.rs index 48ba4470e..1e760333b 100644 --- a/aya-log-parser/src/lib.rs +++ b/aya-log-parser/src/lib.rs @@ -130,6 +130,9 @@ pub fn parse(format_string: &str) -> Result, String> { mod test { use super::*; + // TODO(https://github.com/rust-lang/rust-clippy/issues/13885): narrow this to just the specific + // strings when that doesn't trip the lint. + #[allow(clippy::literal_string_with_formatting_args)] #[test] fn test_parse() { assert_eq!( diff --git a/aya-obj/src/btf/relocation.rs b/aya-obj/src/btf/relocation.rs index 87a1efc0e..eef300d07 100644 --- a/aya-obj/src/btf/relocation.rs +++ b/aya-obj/src/btf/relocation.rs @@ -1068,7 +1068,7 @@ impl ComputedRelocation { } BtfType::Enum64(en) => { let variant = &en.variants[accessor.index]; - (variant.value_high as u64) << 32 | variant.value_low as u64 + ((variant.value_high as u64) << 32) | variant.value_low as u64 } // candidate selection ensures that rel_kind == local_kind == target_kind _ => unreachable!(), diff --git a/aya/src/maps/lpm_trie.rs b/aya/src/maps/lpm_trie.rs index f7efd87fa..328758665 100644 --- a/aya/src/maps/lpm_trie.rs +++ b/aya/src/maps/lpm_trie.rs @@ -63,7 +63,7 @@ pub struct LpmTrie { /// let ipaddr = Ipv4Addr::new(8,8,8,8); /// let key = Key::new(16, u32::from(ipaddr).to_be()); /// ``` -#[repr(packed)] +#[repr(C, packed)] pub struct Key { prefix_len: u32, data: K, diff --git a/ebpf/aya-ebpf/src/maps/lpm_trie.rs b/ebpf/aya-ebpf/src/maps/lpm_trie.rs index 16f947263..cbbcd411e 100644 --- a/ebpf/aya-ebpf/src/maps/lpm_trie.rs +++ b/ebpf/aya-ebpf/src/maps/lpm_trie.rs @@ -18,7 +18,7 @@ pub struct LpmTrie { unsafe impl Sync for LpmTrie {} -#[repr(packed)] +#[repr(C, packed)] pub struct Key { /// Represents the number of bits matched against. pub prefix_len: u32, diff --git a/ebpf/aya-ebpf/src/maps/perf/perf_event_array.rs b/ebpf/aya-ebpf/src/maps/perf/perf_event_array.rs index 18f8c9958..e8caf0b5b 100644 --- a/ebpf/aya-ebpf/src/maps/perf/perf_event_array.rs +++ b/ebpf/aya-ebpf/src/maps/perf/perf_event_array.rs @@ -51,7 +51,7 @@ impl PerfEventArray { } pub fn output_at_index(&self, ctx: &C, index: u32, data: &T, flags: u32) { - let flags = u64::from(flags) << 32 | u64::from(index); + let flags = (u64::from(flags) << 32) | u64::from(index); unsafe { bpf_perf_event_output( ctx.as_ptr(), diff --git a/ebpf/aya-ebpf/src/maps/perf/perf_event_byte_array.rs b/ebpf/aya-ebpf/src/maps/perf/perf_event_byte_array.rs index 2e08ea9cb..8c8771394 100644 --- a/ebpf/aya-ebpf/src/maps/perf/perf_event_byte_array.rs +++ b/ebpf/aya-ebpf/src/maps/perf/perf_event_byte_array.rs @@ -48,7 +48,7 @@ impl PerfEventByteArray { } pub fn output_at_index(&self, ctx: &C, index: u32, data: &[u8], flags: u32) { - let flags = u64::from(flags) << 32 | u64::from(index); + let flags = (u64::from(flags) << 32) | u64::from(index); unsafe { bpf_perf_event_output( ctx.as_ptr(),