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 when default method references associated type that can't be normalized #23485

Closed
nikomatsakis opened this issue Mar 18, 2015 · 0 comments · Fixed by #23486
Closed

ICE when default method references associated type that can't be normalized #23485

nikomatsakis opened this issue Mar 18, 2015 · 0 comments · Fixed by #23486
Labels
A-associated-items Area: Associated items such as associated types and consts. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@nikomatsakis
Copy link
Contributor

This trait causes an ICE when implemented and casted appropriately (from #23300):

trait Iterator {
    type Item;

    fn next(&mut self) -> Option<Self::Item>;

    fn cloned(self) -> Cloned<Self> where
        Self: Sized,
        Self::Item: Deref,
        <Self::Item as Deref>::Target: Clone,
    {
        Cloned { it: self }
    }
}

I'll attach the full test in the PR, it's a pain for me to cut-and-paste it right now :)

@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Mar 18, 2015
@kmcallister kmcallister added the A-associated-items Area: Associated items such as associated types and consts. label Mar 19, 2015
nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Mar 27, 2015
combine normalization with this check so that we also skip the
default method if normalization fails. Fixes rust-lang#23485.
alexcrichton added a commit to alexcrichton/rust that referenced this issue Mar 27, 2015
When testing whether a default method predicates are satisfiable,
combine normalization with this check so that we also skip the
default method if normalization fails. Fixes rust-lang#23485.

r? @nrc (I tried to address your nit from before as well)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items such as associated types and consts. 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.

3 participants