Skip to content

copy and send ifaces cannot be used as type parameter bounds #2284

Closed
@brson

Description

@brson

While ifaces with the name copy and send can be declared and implemented, they are always shadowed by the copy and send kind bounds when used like fn f<T: send>. A small inconsistency.

iface send {
    fn f();
}

fn f<T: send>(t: T) {
    t.f();
}

fn main() {
}
../src/test/run-pass/test.rs:6:4: 6:7 error: attempted access of field f on type 'a, but no public field or method with that name was found
../src/test/run-pass/test.rs:6     t.f();
                                   ^~~
../src/test/run-pass/test.rs:6:4: 6:9 error: the type of this value must be known in this context
../src/test/run-pass/test.rs:6     t.f();
                                   ^~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-grammarArea: The grammar of Rust

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions