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

Need to enforce copyability with "copy" in enum patterns #3255

Closed
bblum opened this issue Aug 23, 2012 · 0 comments
Closed

Need to enforce copyability with "copy" in enum patterns #3255

bblum opened this issue Aug 23, 2012 · 0 comments
Labels
A-typesystem Area: The type system
Milestone

Comments

@bblum
Copy link
Contributor

bblum commented Aug 23, 2012

This shouldn't compile:

fn main() {
    let x = some(unsafe::exclusive(false));
    match move x {
        some(copy z) => {
            do z.with |b| { assert !*b; }
        }
        none => fail
    }
}

Related #2329

@bblum bblum closed this as completed in 37bcd67 Aug 24, 2012
bblum added a commit that referenced this issue Aug 24, 2012
@ghost ghost assigned bblum Aug 24, 2012
catamorphism pushed a commit to catamorphism/rust that referenced this issue Oct 8, 2012
bors added a commit that referenced this issue Jul 9, 2013
…rns, r=catamorphism

Correct treatment of irrefutable patterns. The old code was wrong in many, many ways. `ref` bindings didn't work, it sometimes copied when it should have moved, the borrow checker didn't even look at such patterns at all, we weren't consistent about preventing values with destructors from being pulled apart, etc.

Fixes #3224.
Fixes #3225.
Fixes #3255.
Fixes #6225.
Fixes #6386.

r? @catamorphism
@bblum bblum removed their assignment Jun 16, 2014
jaisnan pushed a commit to jaisnan/rust-dev that referenced this issue Jul 29, 2024
- Contracts cannot duplicate some attributes. I think we need a better
solution than just duplicate all attributes, but for now just filter the
ones we know are problematic.
- Do not make contract generated functions `const` when annotating
constant functions.
  - I also moved the compilation of no_core up since it is much faster.

## Call-out

Need to add a test.

Resolves rust-lang#3251 
Resolves rust-lang#3254
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

Successfully merging a pull request may close this issue.

1 participant