Skip to content

Commit b84e71c

Browse files
committed
Update to latest nightly
1 parent 676fff3 commit b84e71c

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

clippy_lints/src/utils/mod.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -593,18 +593,13 @@ pub fn span_lint_and_sugg<'a, 'tcx: 'a, T: LintContext<'tcx>>(
593593
/// Note: in the JSON format (used by `compiletest_rs`), the help message will appear once per
594594
/// replacement. In human-readable format though, it only appears once before the whole suggestion.
595595
pub fn multispan_sugg(db: &mut DiagnosticBuilder, help_msg: String, sugg: Vec<(Span, String)>) {
596-
let sugg = rustc_errors::RenderSpan::Suggestion(rustc_errors::CodeSuggestion {
596+
let sugg = rustc_errors::CodeSuggestion {
597597
msp: MultiSpan::from_spans(sugg.iter().map(|&(span, _)| span).collect()),
598598
substitutes: sugg.into_iter().map(|(_, subs)| subs).collect(),
599-
});
600-
601-
let sub = rustc_errors::SubDiagnostic {
602-
level: rustc_errors::Level::Help,
603-
message: vec![(help_msg, rustc_errors::snippet::Style::LabelPrimary)],
604-
span: MultiSpan::new(),
605-
render_span: Some(sugg),
599+
msg: help_msg,
606600
};
607-
db.children.push(sub);
601+
assert!(db.suggestion.is_none());
602+
db.suggestion = Some(sugg);
608603
}
609604

610605
/// Return the base type for references and raw pointers.

0 commit comments

Comments
 (0)