Skip to content

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

Description

@nikomatsakis

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 :)

Activity

  1. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    on Mar 18, 2015
  2. added a commit that references this issue on Mar 27, 2015
    70042cf
  3. added a commit that references this issue on Mar 27, 2015
    ac24a51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions