From 6bfb09d9d22517790bc8ecae4a15be11e1dcecd4 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 9 Jun 2014 15:11:26 -0700 Subject: [PATCH 1/2] RFC: Remove cross-borrowing --- active/0000-remove-cross-borrowing.md | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 active/0000-remove-cross-borrowing.md diff --git a/active/0000-remove-cross-borrowing.md b/active/0000-remove-cross-borrowing.md new file mode 100644 index 00000000000..252c6106fd8 --- /dev/null +++ b/active/0000-remove-cross-borrowing.md @@ -0,0 +1,31 @@ +- Start Date: 2014-06-09 +- RFC PR #: (leave this empty) +- Rust Issue #: #10504 + +# Summary + +Remove the coercion from `Box` to `&mut T` from the language. + +# Motivation + +Currently, the coercion between `Box` to `&mut T` can be a hazard because it can lead to surprising mutation where it was not expected. + +# Detailed design + +The coercion between `Box` and `&mut T` should be removed. + +Note that methods that take `&mut self` can still be called on values of type `Box` without any special referencing or dereferencing. That is because the semantics of auto-deref and auto-ref conspire to make it work: the types unify after one autoderef followed by one autoref. + +# Drawbacks + +Borrowing from `Box` to `&mut T` may be convenient. + +# Alternatives + +An alternative is to remove `&T` coercions as well, but this was decided against as they are convenient. + +The impact of not doing this is that the coercion will remain. + +# Unresolved questions + +None. From 5f464692b45d4d7377d8aa28071e413359ff6498 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 24 Jun 2014 17:26:05 -0700 Subject: [PATCH 2/2] Accepted RFC #32: Remove cross borrowing --- ...remove-cross-borrowing.md => 0032-remove-cross-borrowing.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename active/{0000-remove-cross-borrowing.md => 0032-remove-cross-borrowing.md} (96%) diff --git a/active/0000-remove-cross-borrowing.md b/active/0032-remove-cross-borrowing.md similarity index 96% rename from active/0000-remove-cross-borrowing.md rename to active/0032-remove-cross-borrowing.md index 252c6106fd8..9d8b6a7db6b 100644 --- a/active/0000-remove-cross-borrowing.md +++ b/active/0032-remove-cross-borrowing.md @@ -1,5 +1,5 @@ - Start Date: 2014-06-09 -- RFC PR #: (leave this empty) +- RFC PR #: 112 - Rust Issue #: #10504 # Summary