]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/traits/error_reporting.rs
review comments and fix rebase
[rust.git] / src / librustc / traits / error_reporting.rs
index 1321d5348a29962b4f45fb7fbbfd528343eda379..ea29cc0d93f538a51c8f38375e24fde6a6bb4783 100644 (file)
@@ -33,7 +33,7 @@
 use crate::ty::SubtypePredicate;
 use crate::util::nodemap::{FxHashMap, FxHashSet};
 
-use errors::{Applicability, DiagnosticBuilder, pluralise, Style};
+use errors::{Applicability, DiagnosticBuilder, pluralize, Style};
 use std::fmt;
 use syntax::ast;
 use syntax::symbol::{sym, kw};
@@ -1341,7 +1341,7 @@ fn suggest_add_reference_to_arg(
                 param_env,
                 new_trait_ref.to_predicate(),
             );
-            if self.predicate_may_hold(&new_obligation) {
+            if self.predicate_must_hold_modulo_regions(&new_obligation) {
                 if let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span) {
                     // We have a very specific type of error, where just borrowing this argument
                     // might solve the problem. In cases like this, the important part is the
@@ -1371,7 +1371,7 @@ fn suggest_add_reference_to_arg(
                         span,
                         "consider borrowing here",
                         format!("&{}", snippet),
-                        Applicability::MachineApplicable,
+                        Applicability::MaybeIncorrect,
                     );
                     return true;
                 }