Skip to content

Commit fa6c16e

Browse files
authored
Rollup merge of rust-lang#54412 - jcpst:replace_span_suggestion, r=estebank
add applicability to span_suggestion call Found another `span_suggestion` call. Issue rust-lang#50723 r? @estebank
2 parents 99e79c0 + 7f9a259 commit fa6c16e

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)