Skip to content

Inference regression on nightly #44998

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
vickenty opened this issue Oct 3, 2017 · 4 comments
Closed

Inference regression on nightly #44998

vickenty opened this issue Oct 3, 2017 · 4 comments
Labels
A-inference Area: Type inference regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@vickenty
Copy link
Contributor

vickenty commented Oct 3, 2017

This works on stable and beta, fails to compile on nightly.

(Playground)

trait Make {
    fn make() -> Self;
}

impl Make for f64 {
    fn make() -> f64 {
        1.0
    }
}

fn make_value<T: Make>() -> T {
    T::make()
}

fn main() {
    let mut sum = 0.0;
    
    let val = make_value();
    sum += val;
    
    println!("{:}", sum);
}
error[E0282]: type annotations needed
  --> src/main.rs:18:9
   |
18 |     let val = make_value();
   |         ^^^
   |         |
   |         cannot infer type for `_`
   |         consider giving `val` a type

Versions tried:

rustc 1.20.0 (f3d6973f4 2017-08-27) - works
rustc 1.21.0-beta.3 (ea1fd7d42 2017-09-15) - works
rustc 1.22.0-nightly (185cc5f26 2017-10-02) - fails
@leonardo-m
Copy link

See also: #44973

@TimNN TimNN added A-inference Area: Type inference regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 3, 2017
@vickenty
Copy link
Contributor Author

vickenty commented Oct 3, 2017

Extensive discussion of this happened in #41336 and #44287.

@leonardo-m
Copy link

Extensive discussion of this happened in #41336 and #44287.

I've read part of those, and the list of regressions they are listing is exactly the many problems I'm seeing in my code. Apparently I hit every one of them :-) So I guess this breakage is expected and we should close down this issue and #44973 too...

@nikomatsakis
Copy link
Contributor

Closing as expected due to this comment.

cc @rust-lang/libs more fallout from #41336

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-inference Area: Type inference regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants