Skip to content

Commit

Permalink
bpf: appease nightly lint
Browse files Browse the repository at this point in the history
```
error: field `0` is never read
   --> bpf/aya-bpf/src/helpers.rs:737:22
    |
737 | pub struct PrintkArg(u64);
    |            --------- ^^^
    |            |
    |            field in this struct
    |
    = note: `PrintkArg` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
    = note: `-D dead-code` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(dead_code)]`
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
737 | pub struct PrintkArg(());
    |                      ~~
```

See rust-lang/rust#119659.
  • Loading branch information
tamird committed Jan 6, 2024
1 parent 7c1bfef commit 9861c14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bpf/aya-bpf/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,10 @@ pub use bpf_printk;
/// Argument ready to be passed to `printk` BPF helper.
#[repr(transparent)]
#[derive(Copy, Clone)]
pub struct PrintkArg(u64);
pub struct PrintkArg(
#[allow(dead_code)] // TODO(https://github.com/rust-lang/rust/issues/119659): Remove.
u64,
);

impl PrintkArg {
/// Manually construct a `printk` BPF helper argument.
Expand Down

0 comments on commit 9861c14

Please sign in to comment.