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

librustc: allow destructuring of structs with destructors if the pattern has no moves. #6385

Merged
merged 3 commits into from
May 11, 2013

Conversation

huonw
Copy link
Member

@huonw huonw commented May 10, 2013

Caveat: With the current commit, this check only works for matchs, the checks (incorrectly) do not run for patterns in lets, 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.

@huonw
Copy link
Member Author

huonw commented May 10, 2013

@nikomatsakis: I was discussing this with you a day or two ago, do you have any advice about where to go from here?

huonw added 2 commits May 10, 2013 18:34
…ern has no moves.

This check only works for `match`s, the checks (incorrectly) do not run for patterns in
`let`s.
@nikomatsakis
Copy link
Contributor

Nonetheless I think this is a step forward, so I gave it r+. The fact that let patterns are insufficiently checked and handled is covered by bugs #3024 and (sort of) #3224.

@huonw
Copy link
Member Author

huonw commented May 10, 2013

@nikomatsakis I added the issue number, and two tests I'd forgotten to commit the first (and second) time around.

bors added a commit that referenced this pull request 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.
@bors bors closed this May 11, 2013
@bors bors merged commit 912a352 into rust-lang:incoming May 11, 2013
@huonw huonw deleted the rustc-dtor-struct-match branch May 14, 2013 10:08
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.

3 participants