Skip to content

Commit 673de83

Browse files
committed
Fix warning about non-existing cfg in crates using cpp!
Rust nightly started to show warning from invalid `#[cfg]` coming from macro from other crates.
1 parent 58c8c46 commit 673de83

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cpp/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ macro_rules! __cpp_internal {
143143
(@expand_rust_macro [$($a:tt)*] $i:ident [$($an:ident : $at:ty as $ac:tt),*] {$($body:tt)*}) => {
144144
#[allow(non_snake_case)]
145145
#[allow(unused_unsafe)]
146-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::forget_copy))]
147-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::forget_ref))]
146+
#[allow(clippy::forget_copy, clippy::forget_ref)]
148147
#[doc(hidden)]
149148
$($a)* unsafe extern "C" fn $i($($an : *const $at),*) {
150149
$(let $an : $at = unsafe { $an.read() };)*
@@ -156,8 +155,7 @@ macro_rules! __cpp_internal {
156155
(@expand_rust_macro [$($a:tt)*] $i:ident [$($an:ident : $at:ty as $ac:tt),*] -> $rt:ty as $rc:tt {$($body:tt)*}) => {
157156
#[allow(non_snake_case)]
158157
#[allow(unused_unsafe)]
159-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::forget_copy))]
160-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::forget_ref))]
158+
#[allow(clippy::forget_copy, clippy::forget_ref)]
161159
#[doc(hidden)]
162160
$($a)* unsafe extern "C" fn $i($($an : *const $at, )* rt : *mut $rt) -> *mut $rt {
163161

0 commit comments

Comments
 (0)