Skip to content

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

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;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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