diff --git a/rust/pin-init/src/lib.rs b/rust/pin-init/src/lib.rs index 9732af32795c..fd40c8f244a1 100644 --- a/rust/pin-init/src/lib.rs +++ b/rust/pin-init/src/lib.rs @@ -1096,11 +1096,11 @@ unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), E> { /// /// It is unsafe to create this type, since the closure needs to fulfill the same safety /// requirement as the `__pinned_init`/`__init` functions. -struct InitClosure(F, __internal::PhantomInvariant<(E, T)>); +struct InitClosure(F, __internal::PhantomInvariant); // SAFETY: While constructing the `InitClosure`, the user promised that it upholds the // `__init` invariants. -unsafe impl Init for InitClosure +unsafe impl Init for InitClosure where F: FnOnce(*mut T) -> Result<(), E>, { @@ -1112,7 +1112,7 @@ unsafe fn __init(self, slot: *mut T) -> Result<(), E> { // SAFETY: While constructing the `InitClosure`, the user promised that it upholds the // `__pinned_init` invariants. -unsafe impl PinInit for InitClosure +unsafe impl PinInit for InitClosure where F: FnOnce(*mut T) -> Result<(), E>, {