Skip to content

Can we drop reexport pin_mut macro? #2924

@tisonkun

Description

@tisonkun

Currently, futures-util reexport pin_utils::pin_mut! and it is reexported in the facade futures also:

pub use pin_utils::pin_mut;

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions