Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bblum opened this issue Aug 14, 2013 · 0 comments
Closed

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

bblum opened this issue Aug 14, 2013 · 0 comments
Labels
A-traits Area: Trait system A-typesystem Area: The type system

Comments

@bblum
Copy link
Contributor

bblum commented Aug 14, 2013

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));
}
@ghost ghost assigned bblum Aug 14, 2013
@bblum bblum closed this as completed in 369f7fa Aug 22, 2013
@bblum bblum removed their assignment Jun 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-traits Area: Trait system A-typesystem Area: The type system
Projects
None yet
Development

No branches or pull requests

1 participant