Fix rustdoc fallout

This commit is contained in:
Flavio Percoco 2015-01-27 00:35:03 +01:00
parent 7ae8889286
commit 58a8103df9
2 changed files with 16 additions and 0 deletions

View File

@ -39,6 +39,7 @@ pub struct Module {
pub vis: ast::Visibility,
pub stab: Option<attr::Stability>,
pub impls: Vec<Impl>,
pub def_traits: Vec<DefaultTrait>,
pub foreigns: Vec<ast::ForeignMod>,
pub macros: Vec<Macro>,
pub is_crate: bool,
@ -65,6 +66,7 @@ pub fn new(name: Option<Ident>) -> Module {
constants : Vec::new(),
traits : Vec::new(),
impls : Vec::new(),
def_traits : Vec::new(),
foreigns : Vec::new(),
macros : Vec::new(),
is_crate : false,
@ -196,6 +198,12 @@ pub struct Impl {
pub id: ast::NodeId,
}
pub struct DefaultTrait {
pub unsafety: ast::Unsafety,
pub trait_: ast::TraitRef,
pub id: ast::NodeId,
}
pub struct Macro {
pub name: Ident,
pub id: ast::NodeId,

View File

@ -358,6 +358,14 @@ pub fn visit_item(&mut self, item: &ast::Item,
};
om.impls.push(i);
},
ast::ItemDefTrait(unsafety, ref trait_ref) => {
let i = DefaultTrait {
unsafety: unsafety,
trait_: trait_ref.clone(),
id: item.id
};
om.def_traits.push(i);
}
ast::ItemForeignMod(ref fm) => {
om.foreigns.push(fm.clone());
}