Skip to content

overlapping instances should be allowed for traits with no methods #3983

Closed
@brson

Description

@brson

This is what will make inherited kinds work:

trait Bar : Copy {
    fn g();
}

struct A {
    x: int
}

impl A : Bar {
    fn g() { }
}

fn main() {
}

The user is implementing Copy, but the compiler also implements Copy implicitly.

This will also allow kind-based 'assertions':

struct Foo { ... }

// Overlapping instance guarantees that `Foo` is copyable
impl Foo: Copy;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions