Skip to content

Fix soundness hole in struct with expressions, e.g. S{x:foo, .. y} #18672

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

Merged
merged 1 commit into from
Nov 7, 2014

Conversation

brandonson
Copy link
Contributor

Fixes #18567. Struct{x:foo, .. with_expr} did not walk with_expr, which allowed
using moved variables in some cases. The CFG for structs also built up with
with_expr happening before the fields, which is now reversed. (Fields are now
before the with_expr in the CFG)

@brandonson brandonson force-pushed the functional-update-walk branch from 20eb468 to 8f62f21 Compare November 6, 2014 18:39
Fixes rust-lang#18567. Struct{x:foo, .. with_expr} did not walk with_expr, which allowed
using moved variables in some cases.  The CFG for structs also built up with
with_expr happening before the fields, which is now reversed. (Fields are now
before the with_expr in the CFG)
@brandonson brandonson force-pushed the functional-update-walk branch from 8f62f21 to d80a62d Compare November 6, 2014 18:43
@brandonson
Copy link
Contributor Author

Just to keep a record: @nikomatsakis commented on an earlier version asking about comments that I'd accidentally left above the walk_expr change. They were just there to record the problems I was seeing with the CFG fixed as well, and have now been changed.

@nikomatsakis
Copy link
Contributor

r+ with clarification

bors added a commit that referenced this pull request Nov 7, 2014
…matsakis

Fixes #18567. `Struct{x:foo, .. with_expr}` did not walk `with_expr`, which allowed
using moved variables in some cases.  The CFG for structs also built up with
`with_expr` happening before the fields, which is now reversed. (Fields are now
before the `with_expr` in the CFG)
@bors bors closed this Nov 7, 2014
@bors bors merged commit d80a62d into rust-lang:master Nov 7, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Dec 16, 2024
internal: Do not require a special env var to be set for the proc-macro-srv
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.

Struct{x:y, .. old.method_taking_self()} doesn't treat old as a moved value
3 participants