-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Using the derive macros, clippy emits warnings when clippy::pedantic lints are enabled for structures containing fields typed with Option<&Foo>. These errors are emitted on the latest version of Rust, both on the stable and nightly branches.
Here is a minimal reproduction code:
#[derive(bitcode::Decode, bitcode::Encode)]
pub struct Foo<'a> {
pub bar: Option<&'a str>,
}And here are the warnings:
error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
|
| #[derive(bitcode::Decode, bitcode::Encode)]
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_option_ref
...
= note: this error originates in the derive macro `bitcode::Encode` (in Nightly builds, run with -Z macro-backtrace for more info)
error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
|
| #[derive(bitcode::Decode, bitcode::Encode)]
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_option_ref
...
= note: this error originates in the derive macro `bitcode::Decode` (in Nightly builds, run with -Z macro-backtrace for more info)
Metadata
Metadata
Assignees
Labels
No labels