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: cannot encode region variables, for trait object method calls. #17662

Closed
eddyb opened this issue Sep 30, 2014 · 0 comments · Fixed by #17663
Closed

ICE: cannot encode region variables, for trait object method calls. #17662

eddyb opened this issue Sep 30, 2014 · 0 comments · Fixed by #17663
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@eddyb
Copy link
Member

eddyb commented Sep 30, 2014

#![crate_type="lib"]
pub trait Foo<'a, T> {
    fn foo(&self);
}
pub fn foo<'a, T>(x: &'a Foo<'a, T>) {
    let x: &'a Foo<T> = x;
    //            ^ the lifetime parameter of Foo is left to be infered.
    x.foo();
    // ^ encoding this method call in metadata triggers an ICE. 
}

This is caused by writeback leaving around ReInfer in the MethodCallee associated with a method call (because MethodOrigin is not type-folded at all).
cc @nikomatsakis

@kmcallister kmcallister added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants