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 with associated type #21637

Closed
Kimundi opened this issue Jan 26, 2015 · 3 comments
Closed

ICE with associated type #21637

Kimundi opened this issue Jan 26, 2015 · 3 comments
Labels
A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Kimundi
Copy link
Member

Kimundi commented Jan 26, 2015

Reproduced by

pub trait Pattern<'a>: Sized {
    type Matcher;
}

struct CharEqMatcher<'a, C>(C, &'a str);

impl<'a, C> Pattern<'a> for C {
    type Matcher = CharEqMatcher<'a, C>;
}

pub struct MatchIndices<'a, P: Pattern<'a>>(P::Matcher);

impl<'a, P: Pattern<'a>> Clone for MatchIndices<'a, P> where P::Matcher: Clone {
    fn clone(&self) -> Self {
        MatchIndices(Clone::clone(&self.0))
    }
}

fn main() {}
error: internal compiler error: Where clause 
`Binder(TraitRef(<P as pattern::Pattern<'a>>::Matcher, core::marker::Sized))` was applicable to
`Obligation(predicate=Binder(TraitPredicate(TraitRef(P, core::marker::Sized))),depth=62)`
but now is not
@Kimundi
Copy link
Member Author

Kimundi commented Jan 26, 2015

cc @nikomatsakis

@sanxiyn sanxiyn added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 26, 2015
@nikomatsakis nikomatsakis added the A-associated-items Area: Associated items (types, constants & functions) label Jan 26, 2015
@nikomatsakis
Copy link
Contributor

Possible dup of #21212

@nikomatsakis
Copy link
Contributor

I have confirmed this is a dup of #21212

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 (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants