Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we drop reexport pin_mut macro? #2924

Open
tisonkun opened this issue Feb 17, 2025 · 1 comment
Open

Can we drop reexport pin_mut macro? #2924

tisonkun opened this issue Feb 17, 2025 · 1 comment

Comments

@tisonkun
Copy link
Contributor

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.

@taiki-e
Copy link
Member

taiki-e commented Feb 17, 2025

I think it is reasonable to remove it in v0.4, but I don't think v0.3 will do anything since dropping it is a breaking change. However, it may be okay to inline it to remove dependency on pin-utils.

@taiki-e taiki-e added this to the futures-0.4, futures-core-1.0 milestone Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants