]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/passes/bare_urls.rs
Rollup merge of #102883 - Urgau:fix-stabilization-half_open_range_patterns, r=lcnr
[rust.git] / src / librustdoc / passes / bare_urls.rs
index 392e26ea6ac4c3ebffe55c046aaf70365465f26d..7ff3ccef945c2915c0b12833b0a69c70093187ea 100644 (file)
@@ -71,16 +71,14 @@ fn visit_item(&mut self, item: &Item) {
             let report_diag = |cx: &DocContext<'_>, msg: &str, url: &str, range: Range<usize>| {
                 let sp = super::source_span_for_markdown_range(cx.tcx, &dox, &range, &item.attrs)
                     .unwrap_or_else(|| item.attr_span(cx.tcx));
-                cx.tcx.struct_span_lint_hir(crate::lint::BARE_URLS, hir_id, sp, |lint| {
-                    lint.build(msg)
-                        .note("bare URLs are not automatically turned into clickable links")
+                cx.tcx.struct_span_lint_hir(crate::lint::BARE_URLS, hir_id, sp, msg, |lint| {
+                    lint.note("bare URLs are not automatically turned into clickable links")
                         .span_suggestion(
                             sp,
                             "use an automatic link instead",
                             format!("<{}>", url),
                             Applicability::MachineApplicable,
                         )
-                        .emit();
                 });
             };