Skip to content

Shouldn't be able to impl the builtin kinds. #8517

Closed
@bblum

Description

@bblum

Right now the following program will error on the line commented point B, but once #7083 is implemented it will no longer be an error. The program should instead error on line A, or else you could coerce arbitrary types.

trait Send2 : Send { } 

struct X<T>(T);

impl <T> Send for X<T> { } // point A
impl <T> Send2 for X<T> { } 

fn foo<T: Send2>(x: T) {
    let (p,c) = std::comm::oneshot();
    c.send(x); // point B
}

fn main() {
    let mut a = 0;
    foo(X(&mut a));
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions