smol-rs / async-channel

Async multi-producer multi-consumer channel
Apache License 2.0
726 stars 38 forks source link

Async-channel 2.3.0 fails to compile with concurrent-queue below 2.5.0 #92

Closed creberust closed 1 month ago

creberust commented 1 month ago

Hi,

The selected version of concurrent-queue is incorrect in the Cargo.toml and should be at least 2.5 since #89 .

async-channel version 2.3.0 use ForcePushError which is only available since concurrent-queue version 2.5.0.

Thus, if you have any version prior to 2.5.0 in your Cargo.lock, it will not compile. (This actually fails only if you have a version of concurrent-queue previously set to 2.4.0, the others versions are not compatible with event-listener, which is used by concurrent-queue).

Simple steps to reproduce the error:

cargo new ac-bug
cd ac-bug

cargo add async-channel@2.3.0

# Everything works fine because `cargo` will pull the last version of `concurrent-queue` with 2.x.y.
cargo b

# This is valid because `concurrent-queue` should be `^2.4.0` thanks to `event-listener`.
cargo update concurrent-queue --precise 2.4.0 

# Note: This will be rejected
cargo update concurrent-queue --precise 2.3.0

# Kaboom
cargo b