Skip to content

Commit 7f9a259

Browse files
committed
add applicability to span suggestion call
1 parent 3bc2ca7 commit 7f9a259

File tree

1 file changed

+3
-1
lines changed
  • src/librustc_mir/borrow_check/nll/region_infer/error_reporting

1 file changed

+3
-1
lines changed

src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use std::collections::VecDeque;
2222
use std::fmt;
2323
use syntax::symbol::keywords;
2424
use syntax_pos::Span;
25+
use syntax::errors::Applicability;
2526

2627
mod region_name;
2728
mod var_name;
@@ -540,14 +541,15 @@ impl<'tcx> RegionInferenceContext<'tcx> {
540541
RegionName::Named(name) => format!("{}", name),
541542
RegionName::Synthesized(_) => "'_".to_string(),
542543
};
543-
diag.span_suggestion(
544+
diag.span_suggestion_with_applicability(
544545
span,
545546
&format!(
546547
"to allow this impl Trait to capture borrowed data with lifetime \
547548
`{}`, add `{}` as a constraint",
548549
fr_name, suggestable_fr_name,
549550
),
550551
format!("{} + {}", snippet, suggestable_fr_name),
552+
Applicability::MachineApplicable,
551553
);
552554
}
553555
}

0 commit comments

Comments
 (0)