diff --git a/compiler/rustc_resolve/src/rustdoc.rs b/compiler/rustc_resolve/src/rustdoc.rs index 09493ff1ad3..e6f0cf8bf40 100644 --- a/compiler/rustc_resolve/src/rustdoc.rs +++ b/compiler/rustc_resolve/src/rustdoc.rs @@ -504,9 +504,12 @@ pub fn span_of_fragments(fragments: &[DocFragment]) -> Option { /// This method will return `Some` only if one of the following is true: /// /// - The doc is made entirely from sugared doc comments, which cannot contain escapes -/// - The doc is entirely from a single doc fragment, with a string literal, exactly equal +/// - The doc is entirely from a single doc fragment with a string literal exactly equal to `markdown`. /// - The doc comes from `include_str!` /// - The doc includes exactly one substring matching `markdown[md_range]` which is contained in a single doc fragment. +/// +/// This function is defined in the compiler so it can be used by +/// both `rustdoc` and `clippy`. pub fn source_span_for_markdown_range( tcx: TyCtxt<'_>, markdown: &str, diff --git a/src/librustdoc/passes/lint/bare_urls.rs b/src/librustdoc/passes/lint/bare_urls.rs index 01cb5350799..edbe542c125 100644 --- a/src/librustdoc/passes/lint/bare_urls.rs +++ b/src/librustdoc/passes/lint/bare_urls.rs @@ -23,7 +23,7 @@ pub(super) fn visit_item(cx: &DocContext<'_>, item: &Item, hir_id: HirId, dox: & cx.tcx.node_span_lint(crate::lint::BARE_URLS, hir_id, sp, |lint| { lint.primary_message(msg) .note("bare URLs are not automatically turned into clickable links"); - // the fallback of using the item span is suitible for + // the fallback of using the attribute span is suitable for // highlighting where the error is, but not for placing the < and > if let Some(sp) = maybe_sp { lint.multipart_suggestion( diff --git a/tests/rustdoc-ui/lints/bare-urls-limit.rs b/tests/rustdoc-ui/lints/bare-urls-limit.rs index 44df8440921..f64154b0496 100644 --- a/tests/rustdoc-ui/lints/bare-urls-limit.rs +++ b/tests/rustdoc-ui/lints/bare-urls-limit.rs @@ -4,7 +4,7 @@ // examples of bare urls that are beyond our ability to generate suggestions for -// this falls through every heirustic in `source_span_for_markdown_range`, +// this falls through every heuristic in `source_span_for_markdown_range`, // and thus does not get any suggestion. #[doc = "good: \n\n"] //~^ ERROR this URL is not a hyperlink