agerasev / ringbuf

Lock-free SPSC FIFO ring buffer with direct access to inner data
https://crates.io/crates/ringbuf
Apache License 2.0
286 stars 29 forks source link

ringbuf 0.4.3 breaks dependants calling `SharedRb::new` #37

Closed GnomedDev closed 4 weeks ago

GnomedDev commented 1 month ago

songbird 0.4.3 no longer compiles as it is simply calling SharedRb::new which is now ambiguous between ringbuf::SharedRb<Heap<T>::new and ringbuf::SharedRb<Owning<[MaybeUninit<T>; N]>>. The full error is

error[E0034]: multiple applicable items in scope
   --> /home/lothrop/.cargo/git/checkouts/songbird-bfb5fd0fe254c2b1/8f66320/src/input/adapters/async_adapter.rs:159:47
    |
159 |         let (bytes_in, bytes_out) = SharedRb::new(buf_len).split();
    |                                               ^^^ multiple `new` found
    |
    = note: candidate #1 is defined in an impl for the type `ringbuf::SharedRb<Heap<T>>`
    = note: candidate #2 is defined in an impl for the type `ringbuf::SharedRb<Owning<[MaybeUninit<T>; N]>>`

The line quoted is https://github.com/serenity-rs/songbird/blob/2d7dc29fd68826fb6998eb748be05387ea2fe91b/src/input/adapters/async_adapter.rs#L159 and this was probably caused by 6f637f14cb15614732ae1f8421822a71641a604c.

cycle-five commented 1 month ago

+1 https://github.com/cycle-five/cracktunes/actions/runs/10432496012/job/28893244435#step:7:1473

agerasev commented 1 month ago

Thank you for your report!

The issue is caused by adding a StaticRb::new method. I did not expect this to be a breaking change, sorry.

I've yanked 0.4.2 and 0.4.3

brunowonka commented 1 month ago

Quick FYI here I couldn't find it reported anywhere else. Yanking 0.4.3 seems to break async-ringbuf 0.3.0

error: failed to select a version for the requirement `ringbuf = "^0.4.3"`
candidate versions found which didn't match: 0.4.1, 0.4.0, 0.4.0-rc.4, ...
location searched: crates.io index
required by package `async-ringbuf v0.3.0`
    ... which satisfies dependency `async-ringbuf = "^0.3.0"` of package `rust-playground v0.1.0`
if you are looking for the prerelease package it needs to be specified explicitly
    ringbuf = { version = "0.4.0-rc.4" }

https://crates.io/crates/async-ringbuf/0.3.0/dependencies

agerasev commented 1 month ago

Quick FYI here I couldn't find it reported anywhere else. Yanking 0.4.3 seems to break async-ringbuf 0.3.0

Thanks! I've published ringbuf-0.4.4, it seems to fix this.

GnomedDev commented 4 weeks ago

Magic, can't ask for any response better!