You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[package]
name = "playffi"version = "0.1.0"edition = "2021"
[lib]
crate-type = ["staticlib", "lib"]
[dependencies]
safer-ffi = { version = "0.1.2", features = ["proc_macros"] }
use safer_ffi::derive_ReprC;#[derive_ReprC]#[repr(opaque)]pubstructFoo{_x:i32,}
Run the command below:
cargo clippy
Expected result
No lints are emitted.
Actual result
error: incorrect implementation of `clone` on a `Copy` type
--> src/lib.rs:3:1
|
3 | #[derive_ReprC]
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_clone_impl_on_copy_type
= note: `#[deny(clippy::incorrect_clone_impl_on_copy_type)]` on by default
= note: this error originates in the attribute macro `derive_ReprC` (in Nightly builds, run with -Z macro-backtrace for more info)
This clippy lint is new in Rust 1.72.0.
Reproduction
Create a project with the following:
Run the command below:
Expected result
No lints are emitted.
Actual result
Analysis
The macro-expanded code is:
The lint is likely due to the
Clone::clone
implementation being different from*self
.Potential fixes are:
Clone::clone
as returning*self
.(2) may be tricky without bumping the minimum Rust version to 1.72.0.
Let me know if you would like me to open a PR to fix this.
The text was updated successfully, but these errors were encountered: