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

Implement RFC #43 #16102

Merged
merged 4 commits into from
Aug 1, 2014
Merged

Implement RFC #43 #16102

merged 4 commits into from
Aug 1, 2014

Conversation

zwarich
Copy link

@zwarich zwarich commented Jul 30, 2014

This removes the ability of the borrow checker to determine that repeated dereferences of a Box refer to the same memory object.

update: document RFC 130; PR: rust-lang/rfcs#130

@zwarich
Copy link
Author

zwarich commented Jul 30, 2014

In a way, this is kind of a hack to make the borrow checker stupider than it actually is, but I don't know of a better way to do this while supporting OwnedPtr in LoanPath for moves.

@zwarich
Copy link
Author

zwarich commented Jul 30, 2014

CC @nikomatsakis @pcwalton

@nikomatsakis
Copy link
Contributor

I will review but it is difficult this week due to TC39.

@@ -28,6 +28,57 @@ use util::ppaux::Repr;

use std::rc::Rc;

// FIXME: These functions are intended to allow the borrow checker to be less
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you put an issue # here?

@pcwalton
Copy link
Contributor

Looks good modulo that one nit.

Cameron Zwarich added 4 commits July 30, 2014 13:36
Remove the ability of the borrow checker to determine that repeated
dereferences of a Box<T> refer to the same memory object. This will
usually require one of two workarounds:

1) The interior of a Box<T> will sometimes need to be moved / borrowed
into a temporary before moving / borrowing individual derived paths.

2) A `ref x` pattern will have to be replaced with a `box ref x`
pattern.

Fixes #16094.

[breaking-change]
@zwarich
Copy link
Author

zwarich commented Jul 30, 2014

Updated to address @pcwalton's nit.

bors added a commit that referenced this pull request Aug 1, 2014
This removes the ability of the borrow checker to determine that repeated dereferences of a Box<T> refer to the same memory object.
@bors bors closed this Aug 1, 2014
@bors bors merged commit 5d4d09d into rust-lang:master Aug 1, 2014
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the year be 2012-2014?

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.

5 participants