Skip to content

Commit 1664d1d

Browse files
committed
rust: init: macros: Disable clippy::undocumented_unsafe_blocks lint
The missing SAFETY comments should be fixed later... Signed-off-by: Asahi Lina <[email protected]>
1 parent 42b9885 commit 1664d1d

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

rust/kernel/init/macros.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,8 @@ macro_rules! __pinned_drop {
513513
}
514514
),
515515
) => {
516+
#[allow(clippy::undocumented_unsafe_blocks)]
517+
// FIXME
516518
unsafe $($impl_sig)* {
517519
// Inherit all attributes and the type/ident tokens for the signature.
518520
$(#[$($attr)*])*
@@ -850,11 +852,15 @@ macro_rules! __pin_data {
850852
{
851853
type PinData = __ThePinData<$($ty_generics)*>;
852854

855+
#[allow(clippy::undocumented_unsafe_blocks)]
856+
// FIXME
853857
unsafe fn __pin_data() -> Self::PinData {
854858
__ThePinData { __phantom: ::core::marker::PhantomData }
855859
}
856860
}
857861

862+
#[allow(clippy::undocumented_unsafe_blocks)]
863+
// FIXME
858864
unsafe impl<$($impl_generics)*>
859865
$crate::init::__internal::PinData for __ThePinData<$($ty_generics)*>
860866
where $($whr)*
@@ -980,6 +986,8 @@ macro_rules! __pin_data {
980986
slot: *mut $p_type,
981987
init: impl $crate::init::PinInit<$p_type, E>,
982988
) -> ::core::result::Result<(), E> {
989+
#[allow(clippy::undocumented_unsafe_blocks)]
990+
// FIXME
983991
unsafe { $crate::init::PinInit::__pinned_init(init, slot) }
984992
}
985993
)*
@@ -990,6 +998,8 @@ macro_rules! __pin_data {
990998
slot: *mut $type,
991999
init: impl $crate::init::Init<$type, E>,
9921000
) -> ::core::result::Result<(), E> {
1001+
#[allow(clippy::undocumented_unsafe_blocks)]
1002+
// FIXME
9931003
unsafe { $crate::init::Init::__init(init, slot) }
9941004
}
9951005
)*
@@ -1104,6 +1114,8 @@ macro_rules! __init_internal {
11041114
// no possibility of returning without `unsafe`.
11051115
struct __InitOk;
11061116
// Get the data about fields from the supplied type.
1117+
#[allow(clippy::undocumented_unsafe_blocks)]
1118+
// FIXME
11071119
let data = unsafe {
11081120
use $crate::init::__internal::$has_data;
11091121
// Here we abuse `paste!` to retokenize `$t`. Declarative macros have some internal
@@ -1159,6 +1171,7 @@ macro_rules! __init_internal {
11591171
let init = move |slot| -> ::core::result::Result<(), $err> {
11601172
init(slot).map(|__InitOk| ())
11611173
};
1174+
#[allow(clippy::undocumented_unsafe_blocks)]
11621175
let init = unsafe { $crate::init::$construct_closure::<_, $err>(init) };
11631176
init
11641177
}};
@@ -1307,6 +1320,7 @@ macro_rules! __init_internal {
13071320
// Endpoint, nothing more to munch, create the initializer.
13081321
// Since we are in the closure that is never called, this will never get executed.
13091322
// We abuse `slot` to get the correct type inference here:
1323+
#[allow(clippy::undocumented_unsafe_blocks)]
13101324
unsafe {
13111325
// Here we abuse `paste!` to retokenize `$t`. Declarative macros have some internal
13121326
// information that is associated to already parsed fragments, so a path fragment

0 commit comments

Comments
 (0)