-
Notifications
You must be signed in to change notification settings - Fork 656
Description
Currently, futures-util reexport pin_utils::pin_mut!
and it is reexported in the facade futures also:
futures-rs/futures-util/src/lib.rs
Line 26 in 048995a
pub use pin_utils::pin_mut; |
Line 122 in 048995a
pub use futures_util::pin_mut; |
pin-utils::pin_mut
has been deprecated in favor of core lib's core::pin::pin!
since 1.68. However, the semantic of pin_mut
is subtly different from pin
. IIUC -
let object = ...;
pin_mut!(object);
// is equal to
let object = ...;
let object = pin!(object);
(and pin_mut!
support pin multiple values)
I wonder if we can drop reexport pin_mut macro so that we don't depend on a deprecated lib in the next breaking release (0.4), or we should wrap a pin_mut!
based on core::pin::pin
:
#[macro_export]
macro_rules! pin_mut {
($($x:ident),* $(,)?) => { $(
let mut $x = core::pin::pin!($x);
)* }
}
Or we just do nothing and keep the current code forever?
Another related question is whether we could replace futures_core::ready!
with core::task::ready!
when the MSRV is bumped beyond 1.64.
cc @taiki-e since we have related discussions at #2901 and on zulip.