-
Notifications
You must be signed in to change notification settings - Fork 349
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
Stacked Borrow: Barriers #553
Conversation
…list' into memory-data-revived
@@ -0,0 +1,13 @@ | |||
fn inner(x: *mut i32, _y: &i32) { | |||
// If `x` and `y` alias, retagging is fine with this... but we really |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this simply invalidate y
? Without the function call (so if inlined) this would suddenly be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this simply invalidate y?
Yes. But without the barrier, invalidating y
would be okay. Nobody is using y
again, after all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So why are we disallowing this code? y
is unused, even in the main function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we want to enforce that a reference passed to a function is not invalidated while the function executes, no matter whether it is used or not. This is an operational version of "the reference outlives the function".
This can help optimizations that want to introduce new uses.
Oh dang, this breaks the |
This works now locally. @oli-obk did I resolve your questions? |
Uh... it fails to build on Windows? Looks like a rustc bug? EDIT: Reported as rust-lang/rust#56320 |
Probably requires rust-lang/rust#56313 to land |
update miri This should make miri green again :) (Includes rust-lang/miri#553) r? @oli-obk
update miri This should make miri green again :) (Includes rust-lang/miri#553) r? @oli-obk
update miri This should make miri green again :) (Includes rust-lang/miri#553) r? @oli-obk
update miri This should make miri green again :) (Includes rust-lang/miri#553) r? @oli-obk
update miri This should make miri green again :) (Includes rust-lang/miri#553) r? @oli-obk
Waiting for a nightly to happen (seems like we skipped one?)