Skip to content

Commit ef13555

Browse files
committed
rustdoc: Don't assume that a doc attribute was sugared: Fixes #15976
As of 8876ce4, `is_sugared_doc` is encoded in metadata, so there is no need to assume that doc attributes came from sugared comments.
1 parent 1cad408 commit ef13555

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/librustdoc/clean/inline.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,7 @@ fn try_inline_def(cx: &core::DocContext,
124124
pub fn load_attrs(tcx: &ty::ctxt, did: ast::DefId) -> Vec<clean::Attribute> {
125125
let mut attrs = Vec::new();
126126
csearch::get_item_attrs(&tcx.sess.cstore, did, |v| {
127-
attrs.extend(v.move_iter().map(|mut a| {
128-
// FIXME this isn't quite always true, it's just true about 99% of
129-
// the time when dealing with documentation. For example,
130-
// this would treat doc comments of the form `#[doc = "foo"]`
131-
// incorrectly.
132-
if a.name().get() == "doc" && a.value_str().is_some() {
133-
a.node.is_sugared_doc = true;
134-
}
127+
attrs.extend(v.move_iter().map(|a| {
135128
a.clean()
136129
}));
137130
});

0 commit comments

Comments
 (0)