Skip to content

rustc 1.18 beta type inference regression #42179

Closed
@vbarrielle

Description

@vbarrielle

Hello, it looks like type inference has a regression on the latest beta.

With rustc at the version rustc 1.18.0-beta.2 (f4e8e81c3 2017-05-11), the code at https://github.com/vbarrielle/sprs/blob/master/src/sparse/triplet.rs#L464-L483 fails with:

error[E0282]: type annotations needed
   --> src/sparse/triplet.rs:477:13
    |
477 |         let csc = triplet_mat.to_csc();
    |             ^^^
    |             |
    |             consider giving `csc` a type
    |             cannot infer type for `sparse::CsMat<f64, _, std::vec::Vec<usize>, std::vec::Vec<usize>, std::vec::Vec<f64>>`

error: aborting due to previous error

error: Could not compile `sprs`.

However, this compiles fine on stable. It also compiles fine on the latest nightly, so it may have been fixed while fixing another type inference bug eg #41796.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions