Skip to content

Stack overflow with use of Self in inherent impl on trait #23305

Closed
@ghost

Description

pub trait ToNbt<T> {
    fn new(val: T) -> Self;
}

impl ToNbt<Self> {}

fn main() {}
thread 'rustc' has overflowed its stack
Illegal instruction (core dumped)
playpen: application terminated with error code 132
Program ended.

Playpen: http://is.gd/TStXZ9
Thanks @huon helps.

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