Skip to content

DST: cannot provide inherent impl for traits #17750

Closed
@aturon

Description

@aturon

This code:

trait Foo {}

impl Foo {
    fn foo(&self) {}
}

generates this error:

impl-dst.rs:3:1: 5:2 error: duplicate definition of type or module `Foo`
impl-dst.rs:3 impl Foo {
impl-dst.rs:4     fn foo(&self) {}
impl-dst.rs:5 }
impl-dst.rs:1:1: 1:13 note: first definition of type or module `Foo` here
impl-dst.rs:1 trait Foo {}
              ^~~~~~~~~~~~

I couldn't find any existing issue on this, but this is expected to work, right?

Metadata

Metadata

Assignees

Labels

A-DSTsArea: Dynamically-sized types (DSTs)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions