Skip to content

ICE with trait object + associated type #26866

Closed
@BurntSushi

Description

@BurntSushi

Probably not minimal example:

#[derive(Clone, Debug)]
struct Foo;

pub trait Bar {
    fn shrink(&self) -> Box<Iterator<Item=Self>>;
}

impl Bar for Foo {
    fn shrink(&self) -> Box<Iterator<Item=Foo>> {
        Box::new(None.into_iter())
    }
}

fn main() {
}

Version: rustc 1.3.0-nightly (6d71ce536 2015-07-06)

This code was working on the previous nightly---I think the 2015-07-06 nightly introduced this regression. In particular, this very badly breaks any non-trivial use of QuickCheck (which has the same signature as shrink above).

Metadata

Metadata

Assignees

No one assigned

    Labels

    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