about summary refs log tree commit diff
path: root/src/librustc/ich
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-10-03 10:49:27 +0000
committerbors <bors@rust-lang.org>2018-10-03 10:49:27 +0000
commit6ddab3e078bc25bd101d6885427b8a1032f8f60c (patch)
tree9fb5b39c159053a9855c82b818fe5a474f7f1d0c /src/librustc/ich
parent4cf11765dc98536c6eedf33f2df7f72f6e161263 (diff)
parent2be306939dae233ae641ebd692ef45840bb419cb (diff)
downloadrust-6ddab3e078bc25bd101d6885427b8a1032f8f60c.tar.gz
rust-6ddab3e078bc25bd101d6885427b8a1032f8f60c.zip
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
NLL fails to suggest "try removing `&mut` here"

Fixes #51191.

This PR adds ``try removing `&mut` here`` suggestions to functions where a mutable borrow is being taken of a `&mut self` or a `self: &mut Self`. This PR also enables the suggestion for adding a `mut` pattern to by-value implicit self arguments without `mut` patterns already.

r? @nikomatsakis
Diffstat (limited to 'src/librustc/ich')
-rw-r--r--src/librustc/ich/impls_hir.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs
index 676c24a8d3d..23533b7a4c3 100644
--- a/src/librustc/ich/impls_hir.rs
+++ b/src/librustc/ich/impls_hir.rs
@@ -355,7 +355,7 @@ impl_stable_hash_for!(struct hir::FnDecl {
     inputs,
     output,
     variadic,
-    has_implicit_self
+    implicit_self
 });
 
 impl_stable_hash_for!(enum hir::FunctionRetTy {
@@ -363,6 +363,14 @@ impl_stable_hash_for!(enum hir::FunctionRetTy {
     Return(t)
 });
 
+impl_stable_hash_for!(enum hir::ImplicitSelfKind {
+    Imm,
+    Mut,
+    ImmRef,
+    MutRef,
+    None
+});
+
 impl_stable_hash_for!(struct hir::TraitRef {
     // Don't hash the ref_id. It is tracked via the thing it is used to access
     ref_id -> _,