X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Ftraits%2Ferror_reporting.rs;h=ea29cc0d93f538a51c8f38375e24fde6a6bb4783;hb=2fe8371268b36193fa4dc8461341db90f4ec96b9;hp=1321d5348a29962b4f45fb7fbbfd528343eda379;hpb=7a2f3ee73f6286744ff7b36324ddb9fb5dca62ac;p=rust.git diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index 1321d5348a2..ea29cc0d93f 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -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; }