Skip to content

Commit 2fe8371

Browse files
committed
review comments and fix rebase
1 parent 7a2f3ee commit 2fe8371

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/librustc/traits/error_reporting.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use crate::ty::subst::Subst;
3333
use crate::ty::SubtypePredicate;
3434
use crate::util::nodemap::{FxHashMap, FxHashSet};
3535

36-
use errors::{Applicability, DiagnosticBuilder, pluralise, Style};
36+
use errors::{Applicability, DiagnosticBuilder, pluralize, Style};
3737
use std::fmt;
3838
use syntax::ast;
3939
use syntax::symbol::{sym, kw};
@@ -1341,7 +1341,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13411341
param_env,
13421342
new_trait_ref.to_predicate(),
13431343
);
1344-
if self.predicate_may_hold(&new_obligation) {
1344+
if self.predicate_must_hold_modulo_regions(&new_obligation) {
13451345
if let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span) {
13461346
// We have a very specific type of error, where just borrowing this argument
13471347
// might solve the problem. In cases like this, the important part is the
@@ -1371,7 +1371,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13711371
span,
13721372
"consider borrowing here",
13731373
format!("&{}", snippet),
1374-
Applicability::MachineApplicable,
1374+
Applicability::MaybeIncorrect,
13751375
);
13761376
return true;
13771377
}

src/librustc_errors/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub mod registry;
3838
mod styled_buffer;
3939
mod lock;
4040
pub mod json;
41+
pub use snippet::Style;
4142

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

0 commit comments

Comments
 (0)