Skip to content

Commit

Permalink
auto merge of #16766 : kevinmehall/rust/issue-15976, r=alexcrichton
Browse files Browse the repository at this point in the history
As of 8876ce4, `is_sugared_doc` is encoded in metadata, so there is no
need to assume that all `doc` attributes came from sugared comments.

Fixes #15976
  • Loading branch information
bors committed Aug 27, 2014
2 parents 18d6eef + ef13555 commit 3ee047a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/librustdoc/clean/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,7 @@ fn try_inline_def(cx: &core::DocContext,
pub fn load_attrs(tcx: &ty::ctxt, did: ast::DefId) -> Vec<clean::Attribute> {
let mut attrs = Vec::new();
csearch::get_item_attrs(&tcx.sess.cstore, did, |v| {
attrs.extend(v.move_iter().map(|mut a| {
// FIXME this isn't quite always true, it's just true about 99% of
// the time when dealing with documentation. For example,
// this would treat doc comments of the form `#[doc = "foo"]`
// incorrectly.
if a.name().get() == "doc" && a.value_str().is_some() {
a.node.is_sugared_doc = true;
}
attrs.extend(v.move_iter().map(|a| {
a.clean()
}));
});
Expand Down

0 comments on commit 3ee047a

Please sign in to comment.