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

Enforce correct types for channels #724

Closed
eholk opened this issue Jul 21, 2011 · 2 comments
Closed

Enforce correct types for channels #724

eholk opened this issue Jul 21, 2011 · 2 comments
Labels
A-typesystem Area: The type system

Comments

@eholk
Copy link
Contributor

eholk commented Jul 21, 2011

This should fail to compile but currently doesn't.

fn start(chan[@int] c) {
    c <| @42;
}

fn main() {
    auto p = port();
    auto child = spawn start(chan(p));
    auto c; p |> c;
    log_err *c;
}

This will probably be fixed when #568 is fixed.

@msullivan
Copy link
Contributor

What's the problem here?

@eholk
Copy link
Contributor Author

eholk commented Aug 22, 2011

I think the issue is that we're sending a @int, which could be shared mutable state. I'm guessing with move semantics, this is actually legal, since typestate and such will make sure we don't actually share it. I'll go ahead and close this.

@eholk eholk closed this as completed Aug 22, 2011
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
pwd/grp: Add reentrant getgr functions and consolidate getpw functions

Commit messages sum it up.
pdietl pushed a commit to pdietl/rust that referenced this issue Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-typesystem Area: The type system
Projects
None yet
Development

No branches or pull requests

2 participants