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

Retagging: Recurse into compound values #526

Merged
merged 18 commits into from
Nov 20, 2018

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Nov 16, 2018

This matches rust-lang/rust#55916, waiting for that to land.

src/stacked_borrows.rs Outdated Show resolved Hide resolved
src/stacked_borrows.rs Outdated Show resolved Hide resolved
src/fn_call.rs Outdated Show resolved Hide resolved
src/fn_call.rs Outdated Show resolved Hide resolved
}
_ => {}, // nothing to do
}
let mutbl = match place.layout.ty.sty {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be simplified to an if let on builtin_deref(false)

Copy link
Member Author

@RalfJung RalfJung Nov 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately that reports immutable for Box, making it useless.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment explaining this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wat. I need to review all uses of that method now -.-

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do.^^ And/or fix that method? ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is related to the fact that

fn foo(x: &mut i32) { *x = 3 }

works but

fn foo(x: Box<i32>) { *x = 3 }

says it needs a mut, as in mut x: Box<i32>.

src/stacked_borrows.rs Outdated Show resolved Hide resolved
@RalfJung
Copy link
Member Author

Bumped Rust version and merged #523, this should work now.

@RalfJung RalfJung merged commit adfede5 into rust-lang:master Nov 20, 2018
@RalfJung RalfJung deleted the mut-visitor branch November 30, 2018 08:26
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