]>
git.lizzy.rs Git - rust.git/commit
auto merge of #17501 : pcwalton/rust/improve-method-lookup-autoderef, r=nikomatsakis
prefer `Deref` over `DerefMut` in all other circumstances.
Because the compiler now prefers `Deref`, this can break code that
looked like:
let mut foo = bar.borrow_mut();
(*foo).call_something_that_requires_mutable_self();
Replace this code with:
let mut foo = bar.baz();
(&mut *foo).call_something_that_requires_mutable_self();
Closes #12825.
[breaking-change]
r? @nikomatsakis