sparsemat / sprs

sparse linear algebra library for rust
Apache License 2.0
386 stars 45 forks source link

Type parameter error with latest version 0.8.1 #222

Closed bytesnake closed 3 years ago

bytesnake commented 3 years ago

I'm trying to use the latest version 0.8.1 in order to reduce the dependency graph to rayon, but travis fails to compile for stable Rust 1.38.

error[E0210]: type parameter `DS2` must be used as the type parameter for some local type (e.g., `MyStruct<DS2>`)
    --> /home/travis/.cargo/git/checkouts/sprs-d94e86c0e25cf59e/35cde67/src/sparse/csmat.rs:2064:1
     |
2064 | / impl<'a, 'b, N, I, IpS, IS, DS, DS2> Dot<CsMatBase<N, I, IpS, IS, DS>>
2065 | |     for ArrayBase<DS2, Ix2>
2066 | | where
2067 | |     N: 'a + Copy + Num + Default + std::fmt::Debug,
...    |
2112 | |     }
2113 | | }
     | |_^ type parameter `DS2` must be used as the type parameter for some local type
     |
     = note: only traits defined in the current crate can be implemented for a type parameter
mulimoen commented 3 years ago

@bytesnake A temporary fix would be to clear the travis cache to force a newer version of the compiler. 1.38 seems to be a bit old. I am not sure what the minimum supported version is, we should investigate this.

bytesnake commented 3 years ago

yes do that :+1: we will bump the required version number in travis once 0.8 is officially published

vbarrielle commented 3 years ago

I'm not sure I understand the error reported by rustc, nor what should be done on the sprs side. If the issue is an old compiler version, maybe what's needed is to ensure we have a minimum supported rust version.

mulimoen commented 3 years ago

Doing some manual bisection gives a minimal supported rust version of 1.42 for the current master. 1.41 and under does not support the matches macro. 1.40.0 and under gives the same error as in the original issue.

vbarrielle commented 3 years ago

Thanks for doing this bisection @mulimoen !

mulimoen commented 3 years ago

This is due to the minimal rust version. #226 added a notice regarding the minimal rust version