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

soundness holes in let #6225

Closed
thestinger opened this issue May 3, 2013 · 1 comment
Closed

soundness holes in let #6225

thestinger opened this issue May 3, 2013 · 1 comment
Assignees
Labels
A-destructors Area: Destructors (`Drop`, …) A-type-system Area: Type system

Comments

@thestinger
Copy link
Contributor

Related to #3235 because the same holes don't exist in match.

struct Foo {
    n: uint
}

impl Drop for Foo {
    fn finalize(&self) {
        for self.n.times {
            println("pew");
        }
    }
}

fn main() {
    let x = Foo{n: 5};
    let &_y = &x;
}
bors added a commit that referenced this issue May 11, 2013
**Caveat**: With the current commit, this check only works for `match`s, the checks (incorrectly) do not run for patterns in `let`s, and invalid/unsafe code compiles.

I don't know how to fix this, I experimented with some things to try to make let patterns and match patterns run on the same code (since this would presumably fix many of the other unsoundness issues of let-patterns, e.g. #6225), but I don't understand enough of the code. (I think I heard someone talking about a fix for `let` being in progress?)

Fixes #6344 and #6341.
@ghost ghost assigned nikomatsakis Jun 8, 2013
@bblum
Copy link
Contributor

bblum commented Jun 11, 2013

Is this a dup of #3224?

Looks like it should get merged when #3235 is fixed, anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-destructors Area: Destructors (`Drop`, …) A-type-system Area: Type system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants