rust-lang / futures-rs

Zero-cost asynchronous programming in Rust
https://rust-lang.github.io/futures-rs/
Apache License 2.0
5.34k stars 616 forks source link

[question] is pin-project on SelectAll necessary? #2724

Closed yshui closed 1 year ago

yshui commented 1 year ago

https://github.com/rust-lang/futures-rs/blob/8253b784fd45c832ad208d5b8e259f639fc42684/futures-util/src/stream/select_all.rs#L16-L34

FuturesUnordered itself is Unpin, did I miss something?

yshui commented 1 year ago

For the same reason, I think SelectAll doesn't need St: Unpin to implement Stream

taiki-e commented 1 year ago

Yeah, I don't think pin projection is needed here. https://github.com/rust-lang/futures-rs/pull/2431 removed the need for it but forgot to remove it.

For the same reason, I think SelectAll doesn't need St: Unpin to implement Stream

IIRC, it is required by StreamFuture.

yshui commented 1 year ago

it is required by StreamFuture.

Indeed! sorry I missed that :sweat_smile: