Skip to content

Commit

Permalink
review comments and fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Nov 17, 2019
1 parent 7a2f3ee commit 2fe8371
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc/traits/error_reporting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use crate::ty::subst::Subst;
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};
Expand Down Expand Up @@ -1341,7 +1341,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
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
Expand Down Expand Up @@ -1371,7 +1371,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
span,
"consider borrowing here",
format!("&{}", snippet),
Applicability::MachineApplicable,
Applicability::MaybeIncorrect,
);
return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/librustc_errors/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub mod registry;
mod styled_buffer;
mod lock;
pub mod json;
pub use snippet::Style;

pub type PResult<'a, T> = Result<T, DiagnosticBuilder<'a>>;

Expand Down

0 comments on commit 2fe8371

Please sign in to comment.