From ca697d370594aaed020fb252a216b632abc56d33 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 26 Sep 2013 11:57:25 -0700 Subject: rustdoc: Generate documentation for foreign items This slurps up everything inside of an 'extern' block into the enclosing module in order to document them. The documentation must be on the items themselves, and they'll show up next to everything else on the module index pages. Closes #5953 --- src/libsyntax/parse/parser.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 74447b5dae1..7bea1f098c3 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4204,9 +4204,9 @@ impl Parser { } // parse a function declaration from a foreign module - fn parse_item_foreign_fn(&self, attrs: ~[Attribute]) -> @foreign_item { + fn parse_item_foreign_fn(&self, vis: ast::visibility, + attrs: ~[Attribute]) -> @foreign_item { let lo = self.span.lo; - let vis = self.parse_visibility(); // Parse obsolete purity. let purity = self.parse_fn_purity(); @@ -4740,7 +4740,7 @@ impl Parser { if (self.is_keyword(keywords::Fn) || self.is_keyword(keywords::Pure) || self.is_keyword(keywords::Unsafe)) { // FOREIGN FUNCTION ITEM - let item = self.parse_item_foreign_fn(attrs); + let item = self.parse_item_foreign_fn(visibility, attrs); return iovi_foreign_item(item); } self.parse_macro_use_or_failure(attrs,macros_allowed,lo,visibility) -- cgit 1.4.1-3-g733a5