diff --git a/active/0032-remove-cross-borrowing.md b/active/0032-remove-cross-borrowing.md new file mode 100644 index 00000000000..9d8b6a7db6b --- /dev/null +++ b/active/0032-remove-cross-borrowing.md @@ -0,0 +1,31 @@ +- Start Date: 2014-06-09 +- RFC PR #: 112 +- 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.