Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 4 additions & 5 deletions compiler/rustc_resolve/src/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,17 +412,16 @@ pub fn may_be_doc_link(link_type: LinkType) -> bool {
pub(crate) fn attrs_to_preprocessed_links(attrs: &[ast::Attribute]) -> Vec<Box<str>> {
let (doc_fragments, other_attrs) =
attrs_to_doc_fragments(attrs.iter().map(|attr| (attr, None)), false);
let mut doc =
prepare_to_doc_link_resolution(&doc_fragments).into_values().next().unwrap_or_default();
let doc = prepare_to_doc_link_resolution(&doc_fragments).into_values().next();
let mut links = doc.as_deref().map(parse_links).unwrap_or_default();

for attr in other_attrs {
if let Some(note) = attr.deprecation_note() {
doc += note.as_str();
doc += "\n";
links.extend(parse_links(note.as_str()));
}
}

parse_links(&doc)
links
}

/// Similar version of `markdown_links` from rustdoc.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//@ check-pass

// Regression test for https://github.com/rust-lang/rust/issues/157326.
#![allow(rustdoc::invalid_rust_codeblocks)]
#![deprecated(note = "use [Env::try_invoke] instead")]
//! ```

pub struct Env;

impl Env {
pub fn try_invoke(&self) {}
}
Loading