Skip to content

segfault: alt allows uniqueness violation #2657

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

Closed
paulstansifer opened this issue Jun 20, 2012 · 5 comments
Closed

segfault: alt allows uniqueness violation #2657

paulstansifer opened this issue Jun 20, 2012 · 5 comments
Assignees
Labels
A-type-system Area: Type system
Milestone

Comments

@paulstansifer
Copy link
Contributor

We shouldn't be able to duplicate a reference to a unique value. But:

let x = some(~1);
alt x {
  some(y) {
    let a <- x;
    let b <- y;
    // disaster ensues, eventually, potentially, distantly
  }
}

The some() isn't even necessary.

@paulstansifer
Copy link
Contributor Author

This is thematically related to #2329.

@nikomatsakis
Copy link
Contributor

D'oh. This is my fault, liveness or borrowck should prevent moves from bindings---probably borrowck. In any case, this would go away if #2329 were implemented. But it'd be easy to fix in the meantime.

@nikomatsakis
Copy link
Contributor

Actually, I'm a bit surprised that this passes... I should look into this.

@nikomatsakis
Copy link
Contributor

Oh, right, the actual bug here is that borrowck doesn't understand let x <- v.

@ghost ghost assigned nikomatsakis Jun 21, 2012
@nikomatsakis
Copy link
Contributor

this should be fully fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system
Projects
None yet
Development

No branches or pull requests

2 participants