-
-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
This does not occur on v0.3.24. Encountered this when trying to update OpenVMM to v0.3.30.
// Use Option<&X> in case the linker inserts some stray nulls, as we think
// it might on Windows.
//
// See <https://devblogs.microsoft.com/oldnewthing/20181108-00/?p=100165>.
#[linkme::distributed_slice]
pub static WORKERS: [Option<&'static RegisteredWorker>] = [..];
// Always have at least one entry to work around linker bugs.
//
// See <https://github.com/llvm/llvm-project/issues/65855>.
#[linkme::distributed_slice(WORKERS)]
static WORKAROUND: Option<&'static RegisteredWorker> = None;Output:
warning: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
--> support/mesh/mesh_worker/src/worker.rs:624:5
|
624 | #[linkme::distributed_slice(WORKERS)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_option_ref
= note: requested on the command line with `-W clippy::ref-option-ref`
= note: this warning originates in the attribute macro `linkme::distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)
Metadata
Metadata
Assignees
Labels
No labels