1
Fork 0

rustdoc: replace uses of old deriving attribute with new one

This commit is contained in:
Andrew Paseltiner 2013-03-20 11:38:34 -04:00
parent 4055fe83f6
commit baf6a6373f

View file

@ -19,18 +19,18 @@ use core::vec;
pub type AstId = int; pub type AstId = int;
#[deriving_eq] #[deriving(Eq)]
pub struct Doc { pub struct Doc {
pages: ~[Page] pages: ~[Page]
} }
#[deriving_eq] #[deriving(Eq)]
pub enum Page { pub enum Page {
CratePage(CrateDoc), CratePage(CrateDoc),
ItemPage(ItemTag) ItemPage(ItemTag)
} }
#[deriving_eq] #[deriving(Eq)]
pub enum Implementation { pub enum Implementation {
Required, Required,
Provided, Provided,
@ -40,7 +40,7 @@ pub enum Implementation {
* Most rustdocs can be parsed into 'sections' according to their markdown * Most rustdocs can be parsed into 'sections' according to their markdown
* headers * headers
*/ */
#[deriving_eq] #[deriving(Eq)]
pub struct Section { pub struct Section {
header: ~str, header: ~str,
body: ~str body: ~str
@ -49,12 +49,12 @@ pub struct Section {
// FIXME (#2596): We currently give topmod the name of the crate. There // FIXME (#2596): We currently give topmod the name of the crate. There
// would probably be fewer special cases if the crate had its own name // would probably be fewer special cases if the crate had its own name
// and topmod's name was the empty string. // and topmod's name was the empty string.
#[deriving_eq] #[deriving(Eq)]
pub struct CrateDoc { pub struct CrateDoc {
topmod: ModDoc topmod: ModDoc
} }
#[deriving_eq] #[deriving(Eq)]
pub enum ItemTag { pub enum ItemTag {
ModTag(ModDoc), ModTag(ModDoc),
NmodTag(NmodDoc), NmodTag(NmodDoc),
@ -67,7 +67,7 @@ pub enum ItemTag {
StructTag(StructDoc) StructTag(StructDoc)
} }
#[deriving_eq] #[deriving(Eq)]
pub struct ItemDoc { pub struct ItemDoc {
id: AstId, id: AstId,
name: ~str, name: ~str,
@ -79,20 +79,20 @@ pub struct ItemDoc {
reexport: bool reexport: bool
} }
#[deriving_eq] #[deriving(Eq)]
pub struct SimpleItemDoc { pub struct SimpleItemDoc {
item: ItemDoc, item: ItemDoc,
sig: Option<~str> sig: Option<~str>
} }
#[deriving_eq] #[deriving(Eq)]
pub struct ModDoc { pub struct ModDoc {
item: ItemDoc, item: ItemDoc,
items: ~[ItemTag], items: ~[ItemTag],
index: Option<Index> index: Option<Index>
} }
#[deriving_eq] #[deriving(Eq)]
pub struct NmodDoc { pub struct NmodDoc {
item: ItemDoc, item: ItemDoc,
fns: ~[FnDoc], fns: ~[FnDoc],
@ -103,26 +103,26 @@ pub type ConstDoc = SimpleItemDoc;
pub type FnDoc = SimpleItemDoc; pub type FnDoc = SimpleItemDoc;
#[deriving_eq] #[deriving(Eq)]
pub struct EnumDoc { pub struct EnumDoc {
item: ItemDoc, item: ItemDoc,
variants: ~[VariantDoc] variants: ~[VariantDoc]
} }
#[deriving_eq] #[deriving(Eq)]
pub struct VariantDoc { pub struct VariantDoc {
name: ~str, name: ~str,
desc: Option<~str>, desc: Option<~str>,
sig: Option<~str> sig: Option<~str>
} }
#[deriving_eq] #[deriving(Eq)]
pub struct TraitDoc { pub struct TraitDoc {
item: ItemDoc, item: ItemDoc,
methods: ~[MethodDoc] methods: ~[MethodDoc]
} }
#[deriving_eq] #[deriving(Eq)]
pub struct MethodDoc { pub struct MethodDoc {
name: ~str, name: ~str,
brief: Option<~str>, brief: Option<~str>,
@ -132,7 +132,7 @@ pub struct MethodDoc {
implementation: Implementation, implementation: Implementation,
} }
#[deriving_eq] #[deriving(Eq)]
pub struct ImplDoc { pub struct ImplDoc {
item: ItemDoc, item: ItemDoc,
trait_types: ~[~str], trait_types: ~[~str],
@ -142,14 +142,14 @@ pub struct ImplDoc {
pub type TyDoc = SimpleItemDoc; pub type TyDoc = SimpleItemDoc;
#[deriving_eq] #[deriving(Eq)]
pub struct StructDoc { pub struct StructDoc {
item: ItemDoc, item: ItemDoc,
fields: ~[~str], fields: ~[~str],
sig: Option<~str> sig: Option<~str>
} }
#[deriving_eq] #[deriving(Eq)]
pub struct Index { pub struct Index {
entries: ~[IndexEntry] entries: ~[IndexEntry]
} }
@ -164,7 +164,7 @@ pub struct Index {
* * brief - The brief description * * brief - The brief description
* * link - A format-specific string representing the link target * * link - A format-specific string representing the link target
*/ */
#[deriving_eq] #[deriving(Eq)]
pub struct IndexEntry { pub struct IndexEntry {
kind: ~str, kind: ~str,
name: ~str, name: ~str,