Skip to content

Commit

Permalink
Rollup merge of rust-lang#54412 - jcpst:replace_span_suggestion, r=es…
Browse files Browse the repository at this point in the history
…tebank

add applicability to span_suggestion call

Found another `span_suggestion` call. Issue rust-lang#50723

r? @estebank
  • Loading branch information
pietroalbini committed Sep 22, 2018
2 parents 1eee532 + 7f9a259 commit 394d687
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -540,14 +541,15 @@ 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 \
`{}`, add `{}` as a constraint",
fr_name, suggestable_fr_name,
),
format!("{} + {}", snippet, suggestable_fr_name),
Applicability::MachineApplicable,
);
}
}
Expand Down

0 comments on commit 394d687

Please sign in to comment.