Skip to content

rustc: Support irrefutable patterns in function arguments #3930

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
wants to merge 1 commit into from

Conversation

pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Nov 7, 2012

@pcwalton
Copy link
Contributor Author

pcwalton commented Nov 7, 2012

  1. Good point, I'll update the tutorial when I push.
  2. Yes, the plan is to convert all the code over. This addresses (3) too; we could forbid it, but I think it'd be faster to just convert all the old "drop" code over.
  3. I thought about that, but the way to run the destructor is to just drop the last reference. There are many ways to do that.
  4. It has to live in the same crate. We've talked about perhaps tightening it up to the same file; perhaps we should do that.

@nikomatsakis
Copy link
Contributor

With respect to the drop trait: r+ although I think dtors ought to apply equally to enums/structs. In any case, I presume trans is coming later.

@pcwalton
Copy link
Contributor Author

pcwalton commented Nov 8, 2012

re-r? @nikomatsakis

@nikomatsakis
Copy link
Contributor

r+ modulo the change to borrowck. Also, maybe add this as a compile-fail test:

pure fn call_first((x, y): (&fn(), &fn())) { 
    x(); //~ ERROR access to impure function prohibited in pure context
}
fn main() {}

@pcwalton pcwalton closed this Nov 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants