Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy complains about generated code #11

Open
Ploppz opened this issue Oct 20, 2019 · 1 comment
Open

Clippy complains about generated code #11

Ploppz opened this issue Oct 20, 2019 · 1 comment

Comments

@Ploppz
Copy link

Ploppz commented Oct 20, 2019

warning: unsafe function's docs miss `# Safety` section
  --> src/lib.rs:40:1
   |
40 | mopafy!(Widget);
   | ^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(clippy::missing_safety_doc)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
   = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

warning: transmute from a pointer type (`*mut ()`) to a reference type (`&T`)
  --> src/lib.rs:40:1
   |
40 | mopafy!(Widget);
   | ^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(clippy::transmute_ptr_to_ref)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#transmute_ptr_to_ref
   = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

warning: unsafe function's docs miss `# Safety` section
  --> src/lib.rs:40:1
   |
40 | mopafy!(Widget);
   | ^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
   = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

warning: transmute from a pointer type (`*mut ()`) to a reference type (`&mut T`)
  --> src/lib.rs:40:1
   |
40 | mopafy!(Widget);
   | ^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#transmute_ptr_to_ref
   = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

warning: unsafe function's docs miss `# Safety` section
  --> src/lib.rs:40:1
   |
40 | mopafy!(Widget);
   | ^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
   = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
@AndiDog
Copy link

AndiDog commented Jan 15, 2022

Still happens with Rust 1.57.

Workaround (lib.rs / main.rs):

#![allow(clippy::transmute_ptr_to_ref)] // https://github.com/chris-morgan/mopa/issues/11
extern crate mopa;

Then cargo clippy does not complain anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants