]> git.lizzy.rs Git - rust.git/commitdiff
clean module docs while its module ID is still on the stack
authorQuietMisdreavus <grey@quietmisdreavus.net>
Mon, 8 Jan 2018 16:07:16 +0000 (10:07 -0600)
committerManish Goregaokar <manishsmail@gmail.com>
Mon, 22 Jan 2018 09:54:30 +0000 (15:24 +0530)
src/librustdoc/clean/mod.rs

index d4260c3dfb58cbd180d70fd88a45b4bb4d5d2657..cd78209df3055e4a8c8879ef529de7b00d5745ec 100644 (file)
@@ -476,6 +476,7 @@ fn clean(&self, cx: &DocContext) -> Item {
         // we could also pass this down through clean()
         // but that might complicate things.
         cx.mod_ids.borrow_mut().push(self.id);
+        let attrs = self.attrs.clean(cx);
 
         let mut items: Vec<Item> = vec![];
         items.extend(self.extern_crates.iter().map(|x| x.clean(cx)));
@@ -512,7 +513,7 @@ fn clean(&self, cx: &DocContext) -> Item {
 
         Item {
             name: Some(name),
-            attrs: self.attrs.clean(cx),
+            attrs,
             source: whence.clean(cx),
             visibility: self.vis.clean(cx),
             stability: self.stab.clean(cx),