Skip to content

Infinite memory use on invalid program #18418

Closed
@det

Description

@det
struct Pair<A, B>
{
    a : A,
    b : B
}

fn pair<A, B>(a: A, b: B) -> Pair<A, B>
{
    Pair{ a : a, b: b }
}

trait Printable
{
    fn print(&self)
    {
        print!("{}", self)
    }
}


impl<A: Printable, B: Printable> Printable for Pair<A, B>
{
    fn print(&self)
    {
        self.a.print();
        self.b.print();
    }
}

fn print<A: Printable, B: Printable>(t: Pair<A, B>)
{
    t.print();
}

fn main()
{
    print(pair(1, 2));
}

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