Skip to content

stack overflow when trying to compile this code snippet #22773

Closed

Description

I'm on Fedora 21, x86_64.

pub struct A<I: Iterator> {
    iter: I,
    buf: Vec<I::Item>,
}

impl<I: Iterator> Iterator for A<I> where
    I: Iterator<Item=I::Item>
{
    fn next(&mut self) -> Option<I::Item> {
        None
    }
}

fn main() {}

Output:

$ rustc test.rs 

thread 'rustc' has overflowed its stack
Ungültiger Maschinenbefehl (Speicherabzug geschrieben)

(Sorry for the german 😆 )

You can also watch it fail with the playpen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: 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