Skip to content

Commit 3006e75

Browse files
vadorovskyfasterthanlime
authored andcommitted
aya-gen: Disable Debug derive for BTF types
It's a workaround for the upstream bindgen issue: rust-lang/rust-bindgen#2083 tl;dr: Rust nightly complains about #[repr(packed)] structs deriving Debug without Copy. It needs to be fixed properly upstream, but for now we have to disable Debug derive here. Signed-off-by: Michal Rostecki <[email protected]>
1 parent e1b62d2 commit 3006e75

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

aya-gen/src/bindgen.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@ pub fn bpf_builder() -> Builder {
1919
.clang_arg("-Wno-unknown-attributes")
2020
.default_enum_style(EnumVariation::ModuleConsts)
2121
.prepend_enum_name(false)
22+
// NOTE(vadorovsky): It's a workaround for the upstream bindgen issue:
23+
// https://github.com/rust-lang/rust-bindgen/issues/2083
24+
// tl;dr: Rust nightly complains about #[repr(packed)] structs deriving
25+
// Debug without Copy.
26+
// It needs to be fixed properly upstream, but for now we have to
27+
// disable Debug derive here.
28+
.derive_debug(false)
2229
}

0 commit comments

Comments
 (0)