Skip to content

rustc has a stack overflow when using impl Trait of a trait with a generic parameter with a default type of Self #49376

Closed
@quininer

Description

@quininer

https://play.rust-lang.org/?gist=a827cb4bc9dd29324227e3ac676dd47a&version=nightly

#![crate_type = "rlib"] 
#![feature(conservative_impl_trait)]

struct Bar {}
trait Foo<T = Self> {}
impl Foo for Bar {}

fn foo() -> impl Foo {
    Bar {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions