Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,10 @@ pub fn span_lint_and_then<'a, T: LintContext, F>(cx: &'a T, lint: &'static Lint,
/// 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)]) {
let sugg = rustc_errors::RenderSpan::Suggestion(rustc_errors::CodeSuggestion {
msp: MultiSpan::from_spans(sugg.iter().map(|&(span, _)| span).collect()),
msp: MultiSpan {
primary_spans: sugg.iter().map(|&(span, _)| span).collect(),
span_labels: vec![]
},
substitutes: sugg.iter().map(|&(_, subs)| subs.to_owned()).collect(),
});

Expand Down