Skip to content

Manual impls of Foo for Foo should be illegal #20940

Closed
@huonw

Description

@huonw

A manual implementation of a trait for its own DST is currently legal:

trait Foo { fn gen<A>(&self) {} }

impl<'a> Foo for Foo+'a {}

fn main() {}

but shouldn't be. An object-safe Foo gives an ICE #20939, but should also be plain illegal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions