about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKevin Mehall <km@kevinmehall.net>2014-08-26 09:39:26 -0700
committerKevin Mehall <km@kevinmehall.net>2014-08-26 09:39:26 -0700
commitef13555ad1df9d296d0316b511c92ddb47af6743 (patch)
tree73f8c01fbb9a5d45f67e996c43af4f6cb067b973
parent1cad4089ba0dc46248da2459af904e38243f294d (diff)
downloadrust-ef13555ad1df9d296d0316b511c92ddb47af6743.tar.gz
rust-ef13555ad1df9d296d0316b511c92ddb47af6743.zip
rustdoc: Don't assume that a doc attribute was sugared: Fixes #15976
As of 8876ce44, `is_sugared_doc` is encoded in metadata, so there is no
need to assume that doc attributes came from sugared comments.
-rw-r--r--src/librustdoc/clean/inline.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs
index 0e87be1c241..445672fcdc4 100644
--- a/src/librustdoc/clean/inline.rs
+++ b/src/librustdoc/clean/inline.rs
@@ -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()
         }));
     });