Skip to content

Commit e4d1f2e

Browse files
hoshinolinajannau
authored andcommitted
rust: init: macros: Disable clippy::undocumented_unsafe_blocks lint
The missing SAFETY comments should be fixed later... Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent d808c3f commit e4d1f2e

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)*])*
@@ -867,11 +869,15 @@ macro_rules! __pin_data {
867869
{
868870
type PinData = __ThePinData<$($ty_generics)*>;
869871

872+
#[allow(clippy::undocumented_unsafe_blocks)]
873+
// FIXME
870874
unsafe fn __pin_data() -> Self::PinData {
871875
__ThePinData { __phantom: ::core::marker::PhantomData }
872876
}
873877
}
874878

879+
#[allow(clippy::undocumented_unsafe_blocks)]
880+
// FIXME
875881
unsafe impl<$($impl_generics)*>
876882
$crate::init::__internal::PinData for __ThePinData<$($ty_generics)*>
877883
where $($whr)*
@@ -997,6 +1003,8 @@ macro_rules! __pin_data {
9971003
slot: *mut $p_type,
9981004
init: impl $crate::init::PinInit<$p_type, E>,
9991005
) -> ::core::result::Result<(), E> {
1006+
#[allow(clippy::undocumented_unsafe_blocks)]
1007+
// FIXME
10001008
unsafe { $crate::init::PinInit::__pinned_init(init, slot) }
10011009
}
10021010
)*
@@ -1007,6 +1015,8 @@ macro_rules! __pin_data {
10071015
slot: *mut $type,
10081016
init: impl $crate::init::Init<$type, E>,
10091017
) -> ::core::result::Result<(), E> {
1018+
#[allow(clippy::undocumented_unsafe_blocks)]
1019+
// FIXME
10101020
unsafe { $crate::init::Init::__init(init, slot) }
10111021
}
10121022
)*
@@ -1121,6 +1131,8 @@ macro_rules! __init_internal {
11211131
// no possibility of returning without `unsafe`.
11221132
struct __InitOk;
11231133
// Get the data about fields from the supplied type.
1134+
#[allow(clippy::undocumented_unsafe_blocks)]
1135+
// FIXME
11241136
let data = unsafe {
11251137
use $crate::init::__internal::$has_data;
11261138
// Here we abuse `paste!` to retokenize `$t`. Declarative macros have some internal
@@ -1176,6 +1188,7 @@ macro_rules! __init_internal {
11761188
let init = move |slot| -> ::core::result::Result<(), $err> {
11771189
init(slot).map(|__InitOk| ())
11781190
};
1191+
#[allow(clippy::undocumented_unsafe_blocks)]
11791192
let init = unsafe { $crate::init::$construct_closure::<_, $err>(init) };
11801193
init
11811194
}};
@@ -1324,6 +1337,7 @@ macro_rules! __init_internal {
13241337
// Endpoint, nothing more to munch, create the initializer.
13251338
// Since we are in the closure that is never called, this will never get executed.
13261339
// We abuse `slot` to get the correct type inference here:
1340+
#[allow(clippy::undocumented_unsafe_blocks)]
13271341
unsafe {
13281342
// Here we abuse `paste!` to retokenize `$t`. Declarative macros have some internal
13291343
// information that is associated to already parsed fragments, so a path fragment

0 commit comments

Comments
 (0)