RustAudio / dasp

The fundamentals for Digital Audio Signal Processing. Formerly `sample`.
Other
867 stars 63 forks source link

dasp_window fails to compile with error[E0282]: type annotations needed #141

Closed jdanford closed 3 years ago

jdanford commented 3 years ago

dasp_window fails to compile with rustc 1.50.0 / macOS 11.0.1:

error[E0282]: type annotations needed
  --> /Users/jsd/.cargo/registry/src/github.com-1ecc6299db9ec823/dasp_window-0.11.0/src/hanning/mod.rs:25:41
   |
25 |         let v = phase.to_float_sample().to_sample() * PI_2;
   |                                         ^^^^^^^^^ cannot infer type for type parameter `S` declared on the associated function `to_sample`
   |
help: consider specifying the type argument in the method call
   |
25 |         let v = phase.to_float_sample().to_sample::<S>() * PI_2;
   |                                                  ^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0282`.
error: could not compile `dasp_window`
jdanford commented 3 years ago

Update: just switched to master, the necessary type annotation has been added and a number of other changes have been made since the crate was last published – time to bump the version number?

khionu commented 3 years ago

Can we at least get a patch release with this fix?

est31 commented 3 years ago

@mitchmindtree would a patch release be possible? If you have no time, I can make one as well.

stellanhaglund commented 3 years ago

I also ran into this. Are there any workarounds?

jdanford commented 3 years ago

It's fixed on master, so in your Cargo.toml you can reference the repository instead of the published crate, but until #142 gets merged you can use my fork instead of the main repo:

[dependencies.dasp]
git = "https://github.com/jdanford/dasp"
branch = "fix-window-feature-name"
version = "0.11"
est31 commented 3 years ago

Alright so apparently as master had breaking changes, we'd either have to publish 0.12.0 using master, or we'd have to create a new branch with the fix and publish 0.11.2 or something like that.

est31 commented 3 years ago

dasp_window 0.11.1 is out: https://crates.io/crates/dasp_window/0.11.1