Rollup merge of #54412 - jcpst:replace_span_suggestion, r=estebank

add applicability to span_suggestion call

Found another `span_suggestion` call. Issue #50723

r? @estebank
This commit is contained in:
Pietro Albini 2018-09-22 09:56:38 +02:00 committed by GitHub
commit 394d687121
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,7 @@ use std::collections::VecDeque;
use std::fmt;
use syntax::symbol::keywords;
use syntax_pos::Span;
use syntax::errors::Applicability;
mod region_name;
mod var_name;
@ -540,7 +541,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
RegionName::Named(name) => format!("{}", name),
RegionName::Synthesized(_) => "'_".to_string(),
};
diag.span_suggestion(
diag.span_suggestion_with_applicability(
span,
&format!(
"to allow this impl Trait to capture borrowed data with lifetime \
@ -548,6 +549,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
fr_name, suggestable_fr_name,
),
format!("{} + {}", snippet, suggestable_fr_name),
Applicability::MachineApplicable,
);
}
}