Răsfoiți Sursa

bpf: appease nightly lint

```
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 https://github.com/rust-lang/rust/issues/119659.
Tamir Duberstein 1 an în urmă
părinte
comite
9861c1446e
1 a modificat fișierele cu 4 adăugiri și 1 ștergeri
  1. 4 1
      bpf/aya-bpf/src/helpers.rs

+ 4 - 1
bpf/aya-bpf/src/helpers.rs

@@ -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.