diff --git a/aya-log-common/src/lib.rs b/aya-log-common/src/lib.rs index e48757fe..7d538fd4 100644 --- a/aya-log-common/src/lib.rs +++ b/aya-log-common/src/lib.rs @@ -165,6 +165,9 @@ pub enum DisplayHint { // llvm: :0:0: in function _ZN14aya_log_common5write17hc9ed05433e23a663E { i64, i64 } (i8, ptr, i64, ptr, i64): only integer returns supported #[inline(always)] pub(crate) fn write(tag: u8, value: &[u8], buf: &mut [u8]) -> Option { + // TODO(https://github.com/rust-lang/rust-clippy/issues/14112): Remove this allowance when the + // lint behaves more sensibly. + #[allow(clippy::manual_ok_err)] let wire_len: LogValueLength = match value.len().try_into() { Ok(wire_len) => Some(wire_len), Err(TryFromIntError { .. }) => None, diff --git a/aya-obj/src/obj.rs b/aya-obj/src/obj.rs index 4f115024..cfa3f613 100644 --- a/aya-obj/src/obj.rs +++ b/aya-obj/src/obj.rs @@ -1702,7 +1702,7 @@ mod tests { assert_matches!(prog_foo, Program { license, kernel_version: None, - section: ProgramSection::KProbe { .. }, + section: ProgramSection::KProbe, .. } => assert_eq!(license.to_str().unwrap(), "GPL")); @@ -1766,7 +1766,7 @@ mod tests { assert_matches!(prog_foo, Program { license, kernel_version: None, - section: ProgramSection::KProbe { .. }, + section: ProgramSection::KProbe, .. } => assert_eq!(license.to_str().unwrap(), "GPL")); assert_matches!( @@ -1784,7 +1784,7 @@ mod tests { assert_matches!(prog_bar, Program { license, kernel_version: None, - section: ProgramSection::KProbe { .. }, + section: ProgramSection::KProbe , .. } => assert_eq!(license.to_str().unwrap(), "GPL")); assert_matches!( @@ -1916,7 +1916,7 @@ mod tests { assert_matches!( obj.programs.get("foo"), Some(Program { - section: ProgramSection::KProbe { .. }, + section: ProgramSection::KProbe, .. }) ); @@ -2038,7 +2038,7 @@ mod tests { assert_matches!( obj.programs.get("foo"), Some(Program { - section: ProgramSection::TracePoint { .. }, + section: ProgramSection::TracePoint, .. }) ); @@ -2055,7 +2055,7 @@ mod tests { assert_matches!( obj.programs.get("bar"), Some(Program { - section: ProgramSection::TracePoint { .. }, + section: ProgramSection::TracePoint, .. }) ); @@ -2078,7 +2078,7 @@ mod tests { assert_matches!( obj.programs.get("foo"), Some(Program { - section: ProgramSection::SocketFilter { .. }, + section: ProgramSection::SocketFilter, .. }) ); @@ -2148,7 +2148,7 @@ mod tests { assert_matches!( obj.programs.get("foo"), Some(Program { - section: ProgramSection::RawTracePoint { .. }, + section: ProgramSection::RawTracePoint, .. }) ); @@ -2165,7 +2165,7 @@ mod tests { assert_matches!( obj.programs.get("bar"), Some(Program { - section: ProgramSection::RawTracePoint { .. }, + section: ProgramSection::RawTracePoint, .. }) ); @@ -2240,7 +2240,7 @@ mod tests { assert_matches!( obj.programs.get("foo"), Some(Program { - section: ProgramSection::BtfTracePoint { .. }, + section: ProgramSection::BtfTracePoint, .. }) ); @@ -2263,7 +2263,7 @@ mod tests { assert_matches!( obj.programs.get("stream_parser"), Some(Program { - section: ProgramSection::SkSkbStreamParser { .. }, + section: ProgramSection::SkSkbStreamParser, .. }) ); @@ -2286,7 +2286,7 @@ mod tests { assert_matches!( obj.programs.get("my_parser"), Some(Program { - section: ProgramSection::SkSkbStreamParser { .. }, + section: ProgramSection::SkSkbStreamParser, .. }) ); @@ -2407,7 +2407,7 @@ mod tests { assert_matches!( obj.programs.get("ingress"), Some(Program { - section: ProgramSection::CgroupSkbIngress { .. }, + section: ProgramSection::CgroupSkbIngress, .. }) ); @@ -2430,7 +2430,7 @@ mod tests { assert_matches!( obj.programs.get("foo"), Some(Program { - section: ProgramSection::CgroupSkbIngress { .. }, + section: ProgramSection::CgroupSkbIngress, .. }) ); @@ -2453,7 +2453,7 @@ mod tests { assert_matches!( obj.programs.get("skb"), Some(Program { - section: ProgramSection::CgroupSkb { .. }, + section: ProgramSection::CgroupSkb, .. }) ); @@ -2476,7 +2476,7 @@ mod tests { assert_matches!( obj.programs.get("foo"), Some(Program { - section: ProgramSection::CgroupSkb { .. }, + section: ProgramSection::CgroupSkb, .. }) ); diff --git a/aya/src/util.rs b/aya/src/util.rs index 50f96ff4..c95b47db 100644 --- a/aya/src/util.rs +++ b/aya/src/util.rs @@ -258,6 +258,9 @@ fn parse_kernel_symbols(reader: impl BufRead) -> Result, i let addr = parts.next()?; let _kind = parts.next()?; let name = parts.next()?; + // TODO(https://github.com/rust-lang/rust-clippy/issues/14112): Remove this + // allowance when the lint behaves more sensibly. + #[allow(clippy::manual_ok_err)] let addr = match u64::from_str_radix(addr, 16) { Ok(addr) => Some(addr), Err(ParseIntError { .. }) => None, diff --git a/init/src/main.rs b/init/src/main.rs index 524fa972..f5cfc93c 100644 --- a/init/src/main.rs +++ b/init/src/main.rs @@ -138,9 +138,14 @@ fn run() -> anyhow::Result<()> { Err(anyhow::anyhow!("{} failed: {status:?}", path.display())) } }) - .filter_map(|result| match result { - Ok(()) => None, - Err(err) => Some(err), + .filter_map(|result| { + // TODO(https://github.com/rust-lang/rust-clippy/issues/14112): Remove this allowance + // when the lint behaves more sensibly. + #[allow(clippy::manual_ok_err)] + match result { + Ok(()) => None, + Err(err) => Some(err), + } }) .collect::>(); if errors.is_empty() { diff --git a/xtask/src/public_api.rs b/xtask/src/public_api.rs index 8fec2bc6..4eeaaa9c 100644 --- a/xtask/src/public_api.rs +++ b/xtask/src/public_api.rs @@ -77,9 +77,14 @@ pub fn public_api(options: Options, metadata: Metadata) -> Result<()> { } }, ) - .filter_map(|result| match result { - Ok(()) => None, - Err(err) => Some(err), + .filter_map(|result| { + // TODO(https://github.com/rust-lang/rust-clippy/issues/14112): Remove this allowance + // when the lint behaves more sensibly. + #[allow(clippy::manual_ok_err)] + match result { + Ok(()) => None, + Err(err) => Some(err), + } }) .collect();