Skip to content

Commit 0fd0f21

Browse files
committed
small fixes, sync with kernel
1 parent 9f2b049 commit 0fd0f21

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,7 @@ macro_rules! stack_try_pin_init {
399399
(let $var:ident $(: $t:ty)? = $val:expr) => {
400400
let val = $val;
401401
let mut $var = ::core::pin::pin!($crate::__internal::StackInit$(::<$t>)?::uninit());
402-
let mut $var = {
403-
$crate::__internal::StackInit::init($var, val)
404-
};
402+
let mut $var = $crate::__internal::StackInit::init($var, val);
405403
};
406404
(let $var:ident $(: $t:ty)? =? $val:expr) => {
407405
let val = $val;
@@ -900,7 +898,7 @@ pub unsafe trait PinInit<T: ?Sized, E = Infallible>: Sized {
900898
}
901899

902900
/// An initializer returned by [`PinInit::pin_chain`].
903-
pub struct ChainPinInit<I, F, T: ?Sized, E>(I, F, __internal::Invariant<(E, Box<T>)>);
901+
pub struct ChainPinInit<I, F, T: ?Sized, E>(I, F, __internal::Invariant<(E, *const T)>);
904902

905903
// SAFETY: The `__pinned_init` function is implemented such that it
906904
// - returns `Ok(())` on successful initialization,
@@ -1004,7 +1002,7 @@ pub unsafe trait Init<T: ?Sized, E = Infallible>: PinInit<T, E> {
10041002
}
10051003

10061004
/// An initializer returned by [`Init::chain`].
1007-
pub struct ChainInit<I, F, T: ?Sized, E>(I, F, __internal::Invariant<(E, Box<T>)>);
1005+
pub struct ChainInit<I, F, T: ?Sized, E>(I, F, __internal::Invariant<(E, *const T)>);
10081006

10091007
// SAFETY: The `__init` function is implemented such that it
10101008
// - returns `Ok(())` on successful initialization,
@@ -1281,7 +1279,7 @@ impl<T> InPlaceInit<T> for Arc<T> {
12811279
let mut this = Arc::try_new_uninit()?;
12821280
let slot = unsafe { Arc::get_mut_unchecked(&mut this) };
12831281
let slot = slot.as_mut_ptr();
1284-
// SAFETY: when init errors/panics, slot will get deallocated but not dropped,
1282+
// SAFETY: When init errors/panics, slot will get deallocated but not dropped,
12851283
// slot is valid.
12861284
unsafe { init.__init(slot)? };
12871285
// SAFETY: All fields have been initialized.

0 commit comments

Comments
 (0)