Use multispan_sugg
This commit is contained in:
@@ -573,10 +573,10 @@ pub fn span_lint_and_then<'a, 'tcx: 'a, T: LintContext<'tcx>, F>(
|
||||
///
|
||||
/// Note: in the JSON format (used by `compiletest_rs`), the help message will appear once per
|
||||
/// replacement. In human-readable format though, it only appears once before the whole suggestion.
|
||||
pub fn multispan_sugg(db: &mut DiagnosticBuilder, help_msg: String, sugg: &[(Span, &str)]) {
|
||||
pub fn multispan_sugg(db: &mut DiagnosticBuilder, help_msg: String, sugg: Vec<(Span, String)>) {
|
||||
let sugg = rustc_errors::RenderSpan::Suggestion(rustc_errors::CodeSuggestion {
|
||||
msp: MultiSpan::from_spans(sugg.iter().map(|&(span, _)| span).collect()),
|
||||
substitutes: sugg.iter().map(|&(_, subs)| subs.to_owned()).collect(),
|
||||
substitutes: sugg.into_iter().map(|(_, subs)| subs).collect(),
|
||||
});
|
||||
|
||||
let sub = rustc_errors::SubDiagnostic {
|
||||
|
||||
Reference in New Issue
Block a user