Skip to content

Commit e032f1d

Browse files
mimullin-bbrymasmullin2000
authored andcommitted
Ignore clippy lint warning for derive default
Rust version 1.62 made it possible to use #[derive(Default)] (see: rust-lang/rust#94457) As of rust version 1.68, the default clippy configuration will print a warning for manually impl Derive on enums. As such, users of libbpf-cargo will begin to experience clippy warnings when they migrate to version 1.68. libbpf-cargo's minimum rust version is 1.58, thus the recommended method to remove the clippy warnings, is not yet an option for the project. Add a #[allow(clippy::derivable_impls)], to suppress the clippy warning on all generated skeletons. Add a TODO to remove this once the project moves to a minimum rust version of 1.62 Signed-off-by: Michael Mullin <[email protected]>
1 parent 1a8155f commit e032f1d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libbpf-cargo/src/gen.rs

+4
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,9 @@ fn gen_skel_attach(skel: &mut String, object: &mut BpfObj, obj_name: &str) -> Re
670670
fn gen_skel_contents(_debug: bool, raw_obj_name: &str, obj_file_path: &Path) -> Result<String> {
671671
let mut skel = String::new();
672672

673+
// TODO: remove the line
674+
// #[allow(clippy::derivable_impls)]
675+
// once Minimum Rust Version updated to 1.62
673676
write!(
674677
skel,
675678
r#"// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
@@ -683,6 +686,7 @@ fn gen_skel_contents(_debug: bool, raw_obj_name: &str, obj_file_path: &Path) ->
683686
#[allow(non_camel_case_types)]
684687
#[allow(clippy::transmute_ptr_to_ref)]
685688
#[allow(clippy::upper_case_acronyms)]
689+
#[allow(clippy::derivable_impls)]
686690
mod imp {{
687691
use libbpf_rs::libbpf_sys;
688692
"#

0 commit comments

Comments
 (0)