```
error: this call to `as_ref.map(...)` does nothing
--> aya/src/bpf.rs:536:30
|
536 | let btf_fd = btf_fd.as_ref().map(Arc::clone);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `btf_fd.clone()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
note: the lint level is defined here
--> aya/src/lib.rs:41:5
|
41 | clippy::all,
| ^^^^^^^^^^^
= note: `#[deny(clippy::useless_asref)]` implied by `#[deny(clippy::all)]`
error: could not compile `aya` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: initializer for `thread_local` value can be made `const`
--> aya/src/sys/fake.rs:14:61
|
14 | pub(crate) static TEST_MMAP_RET: RefCell<*mut c_void> = RefCell::new(ptr::null_mut());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(ptr::null_mut()) }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#thread_local_initializer_can_be_made_const
= note: `#[deny(clippy::thread_local_initializer_can_be_made_const)]` implied by `#[deny(clippy::all)]`
```
```
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.
```
error: lint `unused_tuple_struct_fields` has been renamed to `dead_code`
--> aya/src/lib.rs:74:5
|
74 | unused_tuple_struct_fields,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `dead_code`
|
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(renamed_and_removed_lints)]`
```
See https://github.com/rust-lang/rust/commit/9fcf9c141068984ffcbb4cb00c.
doctests are not running in CI and therefore the didn't catch the
ringbuf docs failures. This commit fixes the issues in the examples.
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
```
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
--> init/src/main.rs:127:23
|
127 | match (|| {
| _______________________^
128 | | let entry = entry.context("read_dir(/bin) failed")?;
129 | | let path = entry.path();
130 | | let status = std::process::Command::new(&path)
... |
139 | | }
140 | | })() {
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
= note: `#[warn(clippy::blocks_in_conditions)]` on by default
```
https://github.com/rust-lang/rust-clippy/pull/11853 landed in nightly.
Implement pinning for perf_event_array and async_perf_event_array.
Additionally make the core MapData.pin method operate on a reference
rather than a mutable reference.
Signed-off-by: astoycos <astoycos@redhat.com>
There was no reason for them not to be -- the APIs all require mutable
references and hold onto mutable references, so there cannot be internal
concurrency. The !Send + !Sync came from the MMap, but not for any good
reason.