Skip to content

Rust 1.18 regression, constrained-0.1.0, cannot infer type #41796

Closed

Description

@brson

https://github.com/dylanede/constrained

101 brian@ip-10-145-43-250:~/dev/constrained⟫ git log -1
commit d3dfd78ebf46b8a5e03e8f1ef803506c07a2b15d
Merge: 1a03281 d288d01
Author: Dylan Ede <dylanede@googlemail.com>
Date:   Sun Apr 10 13:57:34 2016 +0100

    Merge branch 'master' of github.com:dylanede/constrained
brian@ip-10-145-43-250:/mnt2/dev⟫ rustc +beta -Vv
rustc 1.18.0-beta.1 (4dce67253 2017-04-25)
binary: rustc
commit-hash: 4dce67253d67785c74c8d270c38d774edd0deed8
commit-date: 2017-04-25
host: x86_64-unknown-linux-gnu
release: 1.18.0-beta.1
LLVM version: 3.9
brian@ip-10-145-43-250:~/dev/constrained⟫ cargo +beta test
   Compiling libc v0.2.4
   Compiling winapi-build v0.1.1
   Compiling rustc-serialize v0.3.16
   Compiling winapi v0.2.5
   Compiling advapi32-sys v0.1.2
   Compiling rand v0.3.13
   Compiling num v0.1.30
   Compiling dense_mats v0.4.0
   Compiling sprs v0.3.0
error[E0282]: type annotations needed
   --> /home/brian/.cargo/registry/src/github.life-white.uk-1ecc6299db9ec823/sprs-0.3.0/src/sparse/binop.rs:158:19
    |
158 |       let mut res = match rhs.ordering() {
    |  ___________________^
159 | |         StorageOrder::C => MatOwned::zeros(rhs.shape()),
160 | |         StorageOrder::F => MatOwned::zeros_f(rhs.shape()),
161 | |         _ => unreachable!(),
162 | |     };
    | |_____^ cannot infer type for `dense_mats::Tensor<_, [usize; 2], std::vec::Vec<N>>`

error: aborting due to previous error

error: Could not compile `sprs`.

To learn more, run the command again with --verbose.

cc @dylanede

Activity

  1. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on May 6, 2017
  2. brson commented on May 6, 2017

    @brson
    ContributorAuthor

    Oh the failure is actually in sprs-0.3.0 cc @vbarrielle.

  3. vbarrielle commented on May 7, 2017

    @vbarrielle
    Contributor

    Hello,

    I can fix this with a simple type annotation, but the trouble is, this comes from a fairly old version of sprs (0.3.0, but I'm developping over version 0.5.0 with several breaking changes). I cannot patch version 0.3.0 and submit a fixed version on crates.io, since there are already versions 0.3.x published.

    On solution I can see is for constrained to depend upon version 0.3.3 or later, and I could fix the type inference in a version 0.3.4.

    How does that sound?

  4. Mark-Simulacrum commented on May 8, 2017

    @Mark-Simulacrum
    Member

    84be2df -- #41236 (second time)

  5. brson commented on May 8, 2017

    @brson
    ContributorAuthor

    @vbarrielle let's see if it's a bug on our side before you work around it.

  6. nikomatsakis commented on May 9, 2017

    @nikomatsakis
    Contributor

    Possibly related to #41727

  7. nikomatsakis commented on May 9, 2017

    @nikomatsakis
    Contributor

    Good news, this seems to build on my PR #41716, which is a fix for #41716.

  8. brson commented on May 25, 2017

    @brson
    ContributorAuthor

    Still repros on 1.18.0-beta.3. I'll bump beta to .4.

  9. nikomatsakis commented on May 25, 2017

    @nikomatsakis
    Contributor

    @brson this was backported in #42182, which landed 2 days ago -- not sure which beta that is though

  10. self-assigned this
    on May 25, 2017
  11. nikomatsakis commented on May 31, 2017

    @nikomatsakis
    Contributor

    This seems to work for me now. (I just pulled the latest beta and did a build.) I'm going to close this as a dup of #41716. @dylanede let me know if you disagree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-type-systemArea: Type systemP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions