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
This commit is contained in:
parent
c429c7c04b
commit
ca697d3705
6 changed files with 88 additions and 33 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue