Skip to content

Commit

Permalink
Fix warning about non-existing cfg in crates using cpp!
Browse files Browse the repository at this point in the history
Rust nightly started to show warning from invalid `#[cfg]` coming from
macro from other crates.
  • Loading branch information
ogoffart committed Nov 20, 2024
1 parent 58c8c46 commit 673de83
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cpp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ macro_rules! __cpp_internal {
(@expand_rust_macro [$($a:tt)*] $i:ident [$($an:ident : $at:ty as $ac:tt),*] {$($body:tt)*}) => {
#[allow(non_snake_case)]
#[allow(unused_unsafe)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::forget_copy))]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::forget_ref))]
#[allow(clippy::forget_copy, clippy::forget_ref)]
#[doc(hidden)]
$($a)* unsafe extern "C" fn $i($($an : *const $at),*) {
$(let $an : $at = unsafe { $an.read() };)*
Expand All @@ -156,8 +155,7 @@ macro_rules! __cpp_internal {
(@expand_rust_macro [$($a:tt)*] $i:ident [$($an:ident : $at:ty as $ac:tt),*] -> $rt:ty as $rc:tt {$($body:tt)*}) => {
#[allow(non_snake_case)]
#[allow(unused_unsafe)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::forget_copy))]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::forget_ref))]
#[allow(clippy::forget_copy, clippy::forget_ref)]
#[doc(hidden)]
$($a)* unsafe extern "C" fn $i($($an : *const $at, )* rt : *mut $rt) -> *mut $rt {

Expand Down

0 comments on commit 673de83

Please sign in to comment.