Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ICE on all current Rust channels #42950

Closed
vitalyd opened this issue Jun 28, 2017 · 7 comments
Closed

ICE on all current Rust channels #42950

vitalyd opened this issue Jun 28, 2017 · 7 comments
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@vitalyd
Copy link

vitalyd commented Jun 28, 2017

While playing around with the scenario mentioned in https://users.rust-lang.org/t/intoiterator-and-lifetimes/11574, I hit an ICE with the following message:

error: internal compiler error: /checkout/src/librustc/infer/mod.rs:573: Encountered errors [FulfillmentError(Obligation(predicate=Binder(TraitPredicate(<[closure@<anon>:70:23: 70:29] as std::ops::FnOnce<(Record<'_>,)>>)),depth=0),OutputTypeParameterMismatch(Binder(<[closure@<anon>:70:23: 70:29] as std::ops::FnOnce<(<&DataSet as std::iter::IntoIterator>::Item,)>>), Binder(<[closure@<anon>:70:23: 70:29] as std::ops::FnOnce<(Record<'_>,)>>), Sorts(ExpectedFound { expected: Record<'_>, found: <&DataSet as std::iter::IntoIterator>::Item })))] resolving bounds after type-checking

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.20.0-nightly (f590a44 2017-06-27) running on x86_64-unknown-linux-gnu

thread 'rustc' panicked at 'Box', /checkout/src/librustc_errors/lib.rs:426
note: Run with RUST_BACKTRACE=1 for a backtrace.

This also happens on the current stable (rustc 1.18.0 (03fc9d6 2017-06-06)) channel as well. Here's a repro on the playground.

@Mark-Simulacrum Mark-Simulacrum added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jun 28, 2017
@est31
Copy link
Member

est31 commented Jun 28, 2017

Minified

@est31
Copy link
Member

est31 commented Jun 28, 2017

Even more minified:

struct D;

trait Tr {
    type It;
    fn foo(self) -> Option<Self::It>;
}

impl<'a> Tr for &'a D {
    type It = ();
    fn foo(self) -> Option<()> { None }
}

fn run<F>(f: F)
    where for<'a> &'a D: Tr,
          F: Fn(<&D as Tr>::It),
{
    let d = &D;
    while let Some(i) = d.foo() {
        f(i);
    }
}

fn main() {
    run(|_| {});
}

@arielb1 arielb1 self-assigned this Jun 29, 2017
@vitalyd
Copy link
Author

vitalyd commented Jun 30, 2017

@arielb1 / @est31 , just wondering - should the formulation that I tried work? Or would it have failed compilation anyway if the ICE didn't come in the way? Thanks

@arielb1
Copy link
Contributor

arielb1 commented Jul 2, 2017

Looks like a duplicate of #33364. This should work with that bug fixed.

@steveklabnik
Copy link
Member

Triage: this still ICEs

@estebank
Copy link
Contributor

CC #29997.

@pnkfelix
Copy link
Member

closing as duplicate of #62529, which is where I will try to track future instances of this field of ICE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

7 participants