Skip to content

Commit 3fe4cc1

Browse files
committed
replace clippy expect with allow
`clippy` has changed behavior in [1] (Rust 1.95) where it no longer warns about the `let_and_return` lint when a comment is placed between the let binding and the return expression. Nightly thus fails to build, because the expectation is no longer fulfilled. Thus replace the expectation with an `allow`. Link: rust-lang/rust-clippy#16461 [1] Signed-off-by: Benno Lossin <lossin@kernel.org>
1 parent 9a092f8 commit 3fe4cc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,13 +1143,13 @@ pub const unsafe fn init_from_closure<T: ?Sized, E>(
11431143
///
11441144
/// - `*mut U` must be castable to `*mut T` and any value of type `T` written through such a
11451145
/// pointer must result in a valid `U`.
1146-
#[expect(clippy::let_and_return)]
11471146
pub const unsafe fn cast_pin_init<T, U, E>(init: impl PinInit<T, E>) -> impl PinInit<U, E> {
11481147
// SAFETY: initialization delegated to a valid initializer. Cast is valid by function safety
11491148
// requirements.
11501149
let res = unsafe { pin_init_from_closure(|ptr: *mut U| init.__pinned_init(ptr.cast::<T>())) };
11511150
// FIXME: remove the let statement once the nightly-MSRV allows it (1.78 otherwise encounters a
11521151
// cycle when computing the type returned by this function)
1152+
#[allow(clippy::let_and_return)]
11531153
res
11541154
}
11551155

@@ -1159,13 +1159,13 @@ pub const unsafe fn cast_pin_init<T, U, E>(init: impl PinInit<T, E>) -> impl Pin
11591159
///
11601160
/// - `*mut U` must be castable to `*mut T` and any value of type `T` written through such a
11611161
/// pointer must result in a valid `U`.
1162-
#[expect(clippy::let_and_return)]
11631162
pub const unsafe fn cast_init<T, U, E>(init: impl Init<T, E>) -> impl Init<U, E> {
11641163
// SAFETY: initialization delegated to a valid initializer. Cast is valid by function safety
11651164
// requirements.
11661165
let res = unsafe { init_from_closure(|ptr: *mut U| init.__init(ptr.cast::<T>())) };
11671166
// FIXME: remove the let statement once the nightly-MSRV allows it (1.78 otherwise encounters a
11681167
// cycle when computing the type returned by this function)
1168+
#[allow(clippy::let_and_return)]
11691169
res
11701170
}
11711171

0 commit comments

Comments
 (0)