From eb08e8fec2d43bc325ae869fcf10a597f38635db Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 28 Mar 2014 10:27:24 -0700 Subject: [PATCH] rustdoc: Switch field privacy as necessary --- src/librustdoc/clean.rs | 204 ++++++++++++++++++---------------- src/librustdoc/core.rs | 8 +- src/librustdoc/doctree.rs | 162 +++++++++++++-------------- src/librustdoc/flock.rs | 40 +++---- src/librustdoc/html/layout.rs | 12 +- src/librustdoc/html/render.rs | 36 +++--- src/librustdoc/html/toc.rs | 16 +-- src/librustdoc/plugins.rs | 6 +- src/librustdoc/test.rs | 18 +-- src/librustdoc/visit_ast.rs | 8 +- 10 files changed, 259 insertions(+), 251 deletions(-) diff --git a/src/librustdoc/clean.rs b/src/librustdoc/clean.rs index 0bc3da15462..ff7f7c6e6f4 100644 --- a/src/librustdoc/clean.rs +++ b/src/librustdoc/clean.rs @@ -64,9 +64,9 @@ fn clean(&self) -> Vec { #[deriving(Clone, Encodable, Decodable)] pub struct Crate { - name: ~str, - module: Option, - externs: Vec<(ast::CrateNum, ExternalCrate)> , + pub name: ~str, + pub module: Option, + pub externs: Vec<(ast::CrateNum, ExternalCrate)>, } impl<'a> Clean for visit_ast::RustdocVisitor<'a> { @@ -92,8 +92,8 @@ fn clean(&self) -> Crate { #[deriving(Clone, Encodable, Decodable)] pub struct ExternalCrate { - name: ~str, - attrs: Vec , + pub name: ~str, + pub attrs: Vec, } impl Clean for cstore::crate_metadata { @@ -113,13 +113,13 @@ fn clean(&self) -> ExternalCrate { #[deriving(Clone, Encodable, Decodable)] pub struct Item { /// Stringified span - source: Span, + pub source: Span, /// Not everything has a name. E.g., impls - name: Option<~str>, - attrs: Vec , - inner: ItemEnum, - visibility: Option, - id: ast::NodeId, + pub name: Option<~str>, + pub attrs: Vec , + pub inner: ItemEnum, + pub visibility: Option, + pub id: ast::NodeId, } impl Item { @@ -192,8 +192,8 @@ pub enum ItemEnum { #[deriving(Clone, Encodable, Decodable)] pub struct Module { - items: Vec , - is_crate: bool, + pub items: Vec, + pub is_crate: bool, } impl Clean for doctree::Module { @@ -289,9 +289,10 @@ fn name_str_pair(&self) -> Option<(InternedString, InternedString)> { #[deriving(Clone, Encodable, Decodable)] pub struct TyParam { - name: ~str, - id: ast::NodeId, - bounds: Vec } + pub name: ~str, + pub id: ast::NodeId, + pub bounds: Vec, +} impl Clean for ast::TyParam { fn clean(&self) -> TyParam { @@ -338,8 +339,9 @@ fn clean(&self) -> Lifetime { // maybe use a Generic enum and use ~[Generic]? #[deriving(Clone, Encodable, Decodable)] pub struct Generics { - lifetimes: Vec , - type_params: Vec } + pub lifetimes: Vec, + pub type_params: Vec, +} impl Clean for ast::Generics { fn clean(&self) -> Generics { @@ -352,10 +354,10 @@ fn clean(&self) -> Generics { #[deriving(Clone, Encodable, Decodable)] pub struct Method { - generics: Generics, - self_: SelfTy, - purity: ast::Purity, - decl: FnDecl, + pub generics: Generics, + pub self_: SelfTy, + pub purity: ast::Purity, + pub decl: FnDecl, } impl Clean for ast::Method { @@ -390,10 +392,10 @@ fn clean(&self) -> Item { #[deriving(Clone, Encodable, Decodable)] pub struct TyMethod { - purity: ast::Purity, - decl: FnDecl, - generics: Generics, - self_: SelfTy, + pub purity: ast::Purity, + pub decl: FnDecl, + pub generics: Generics, + pub self_: SelfTy, } impl Clean for ast::TypeMethod { @@ -447,9 +449,9 @@ fn clean(&self) -> SelfTy { #[deriving(Clone, Encodable, Decodable)] pub struct Function { - decl: FnDecl, - generics: Generics, - purity: ast::Purity, + pub decl: FnDecl, + pub generics: Generics, + pub purity: ast::Purity, } impl Clean for doctree::Function { @@ -471,13 +473,14 @@ fn clean(&self) -> Item { #[deriving(Clone, Encodable, Decodable)] pub struct ClosureDecl { - sigil: ast::Sigil, - region: Option, - lifetimes: Vec , - decl: FnDecl, - onceness: ast::Onceness, - purity: ast::Purity, - bounds: Vec } + pub sigil: ast::Sigil, + pub region: Option, + pub lifetimes: Vec, + pub decl: FnDecl, + pub onceness: ast::Onceness, + pub purity: ast::Purity, + pub bounds: Vec, +} impl Clean for ast::ClosureTy { fn clean(&self) -> ClosureDecl { @@ -498,14 +501,15 @@ fn clean(&self) -> ClosureDecl { #[deriving(Clone, Encodable, Decodable)] pub struct FnDecl { - inputs: Arguments, - output: Type, - cf: RetStyle, - attrs: Vec } + pub inputs: Arguments, + pub output: Type, + pub cf: RetStyle, + pub attrs: Vec, +} #[deriving(Clone, Encodable, Decodable)] pub struct Arguments { - values: Vec , + pub values: Vec, } impl Clean for ast::FnDecl { @@ -523,9 +527,9 @@ fn clean(&self) -> FnDecl { #[deriving(Clone, Encodable, Decodable)] pub struct Argument { - type_: Type, - name: ~str, - id: ast::NodeId + pub type_: Type, + pub name: ~str, + pub id: ast::NodeId, } impl Clean for ast::Arg { @@ -555,9 +559,9 @@ fn clean(&self) -> RetStyle { #[deriving(Clone, Encodable, Decodable)] pub struct Trait { - methods: Vec , - generics: Generics, - parents: Vec , + pub methods: Vec, + pub generics: Generics, + pub parents: Vec, } impl Clean for doctree::Trait { @@ -626,17 +630,17 @@ fn clean(&self) -> TraitMethod { pub enum Type { /// structs/enums/traits (anything that'd be an ast::TyPath) ResolvedPath { - path: Path, - typarams: Option >, - id: ast::NodeId, + pub path: Path, + pub typarams: Option>, + pub id: ast::NodeId, }, /// Same as above, but only external variants ExternalPath { - path: Path, - typarams: Option >, - fqn: Vec<~str> , - kind: TypeKind, - krate: ast::CrateNum, + pub path: Path, + pub typarams: Option>, + pub fqn: Vec<~str>, + pub kind: TypeKind, + pub krate: ast::CrateNum, }, // I have no idea how to usefully use this. TyParamBinder(ast::NodeId), @@ -662,7 +666,11 @@ pub enum Type { Unique(~Type), Managed(~Type), RawPointer(Mutability, ~Type), - BorrowedRef { lifetime: Option, mutability: Mutability, type_: ~Type}, + BorrowedRef { + pub lifetime: Option, + pub mutability: Mutability, + pub type_: ~Type, + }, // region, raw, other boxes, mutable } @@ -707,7 +715,7 @@ fn clean(&self) -> Type { #[deriving(Clone, Encodable, Decodable)] pub struct StructField { - type_: Type, + pub type_: Type, } impl Clean for ast::StructField { @@ -739,10 +747,10 @@ fn clean(&self) -> Option { #[deriving(Clone, Encodable, Decodable)] pub struct Struct { - struct_type: doctree::StructType, - generics: Generics, - fields: Vec , - fields_stripped: bool, + pub struct_type: doctree::StructType, + pub generics: Generics, + pub fields: Vec, + pub fields_stripped: bool, } impl Clean for doctree::Struct { @@ -768,9 +776,9 @@ fn clean(&self) -> Item { /// only as a variant in an enum. #[deriving(Clone, Encodable, Decodable)] pub struct VariantStruct { - struct_type: doctree::StructType, - fields: Vec , - fields_stripped: bool, + pub struct_type: doctree::StructType, + pub fields: Vec, + pub fields_stripped: bool, } impl Clean for syntax::ast::StructDef { @@ -785,9 +793,9 @@ fn clean(&self) -> VariantStruct { #[deriving(Clone, Encodable, Decodable)] pub struct Enum { - variants: Vec , - generics: Generics, - variants_stripped: bool, + pub variants: Vec, + pub generics: Generics, + pub variants_stripped: bool, } impl Clean for doctree::Enum { @@ -809,7 +817,7 @@ fn clean(&self) -> Item { #[deriving(Clone, Encodable, Decodable)] pub struct Variant { - kind: VariantKind, + pub kind: VariantKind, } impl Clean for doctree::Variant { @@ -851,11 +859,11 @@ fn clean(&self) -> VariantKind { #[deriving(Clone, Encodable, Decodable)] pub struct Span { - filename: ~str, - loline: uint, - locol: uint, - hiline: uint, - hicol: uint, + pub filename: ~str, + pub loline: uint, + pub locol: uint, + pub hiline: uint, + pub hicol: uint, } impl Clean for syntax::codemap::Span { @@ -876,8 +884,8 @@ fn clean(&self) -> Span { #[deriving(Clone, Encodable, Decodable)] pub struct Path { - global: bool, - segments: Vec , + pub global: bool, + pub segments: Vec, } impl Clean for ast::Path { @@ -891,9 +899,9 @@ fn clean(&self) -> Path { #[deriving(Clone, Encodable, Decodable)] pub struct PathSegment { - name: ~str, - lifetimes: Vec , - types: Vec , + pub name: ~str, + pub lifetimes: Vec, + pub types: Vec, } impl Clean for ast::PathSegment { @@ -930,8 +938,8 @@ fn clean(&self) -> ~str { #[deriving(Clone, Encodable, Decodable)] pub struct Typedef { - type_: Type, - generics: Generics, + pub type_: Type, + pub generics: Generics, } impl Clean for doctree::Typedef { @@ -952,10 +960,10 @@ fn clean(&self) -> Item { #[deriving(Clone, Encodable, Decodable)] pub struct BareFunctionDecl { - purity: ast::Purity, - generics: Generics, - decl: FnDecl, - abi: ~str + pub purity: ast::Purity, + pub generics: Generics, + pub decl: FnDecl, + pub abi: ~str, } impl Clean for ast::BareFnTy { @@ -974,12 +982,12 @@ fn clean(&self) -> BareFunctionDecl { #[deriving(Clone, Encodable, Decodable)] pub struct Static { - type_: Type, - mutability: Mutability, + pub type_: Type, + pub mutability: Mutability, /// It's useful to have the value of a static documented, but I have no /// desire to represent expressions (that'd basically be all of the AST, /// which is huge!). So, have a string. - expr: ~str, + pub expr: ~str, } impl Clean for doctree::Static { @@ -1017,11 +1025,11 @@ fn clean(&self) -> Mutability { #[deriving(Clone, Encodable, Decodable)] pub struct Impl { - generics: Generics, - trait_: Option, - for_: Type, - methods: Vec, - derived: bool, + pub generics: Generics, + pub trait_: Option, + pub for_: Type, + pub methods: Vec, + pub derived: bool, } impl Clean for doctree::Impl { @@ -1056,7 +1064,7 @@ fn clean(&self) -> Item { #[deriving(Clone, Encodable, Decodable)] pub struct ViewItem { - inner: ViewItemInner + pub inner: ViewItemInner, } impl Clean for ast::ViewItem { @@ -1109,8 +1117,8 @@ pub enum ViewPath { #[deriving(Clone, Encodable, Decodable)] pub struct ImportSource { - path: Path, - did: Option, + pub path: Path, + pub did: Option, } impl Clean for ast::ViewPath { @@ -1130,8 +1138,8 @@ fn clean(&self) -> ViewPath { #[deriving(Clone, Encodable, Decodable)] pub struct ViewListIdent { - name: ~str, - source: Option, + pub name: ~str, + pub source: Option, } impl Clean for ast::PathListIdent { @@ -1311,7 +1319,7 @@ fn resolve_def(id: ast::NodeId) -> Option { #[deriving(Clone, Encodable, Decodable)] pub struct Macro { - source: ~str, + pub source: ~str, } impl Clean for doctree::Macro { diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 7fb40a09693..027d14babaf 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -32,8 +32,8 @@ pub enum MaybeTyped { } pub struct DocContext { - krate: ast::Crate, - maybe_typed: MaybeTyped + pub krate: ast::Crate, + pub maybe_typed: MaybeTyped } impl DocContext { @@ -46,8 +46,8 @@ pub fn sess<'a>(&'a self) -> &'a driver::session::Session { } pub struct CrateAnalysis { - exported_items: privacy::ExportedItems, - public_items: privacy::PublicItems, + pub exported_items: privacy::ExportedItems, + pub public_items: privacy::PublicItems, } /// Parses, resolves, and typechecks the given crate diff --git a/src/librustdoc/doctree.rs b/src/librustdoc/doctree.rs index 2bd2e7a8e5c..78b1a1388f8 100644 --- a/src/librustdoc/doctree.rs +++ b/src/librustdoc/doctree.rs @@ -17,23 +17,23 @@ use syntax::ast::{Ident, NodeId}; pub struct Module { - name: Option, - attrs: Vec , - where: Span, - structs: Vec , - enums: Vec , - fns: Vec , - mods: Vec , - id: NodeId, - typedefs: Vec , - statics: Vec , - traits: Vec , - vis: ast::Visibility, - impls: Vec , - foreigns: Vec , - view_items: Vec , - macros: Vec , - is_crate: bool, + pub name: Option, + pub attrs: Vec, + pub where: Span, + pub structs: Vec, + pub enums: Vec, + pub fns: Vec, + pub mods: Vec, + pub id: NodeId, + pub typedefs: Vec, + pub statics: Vec, + pub traits: Vec, + pub vis: ast::Visibility, + pub impls: Vec, + pub foreigns: Vec, + pub view_items: Vec, + pub macros: Vec, + pub is_crate: bool, } impl Module { @@ -78,94 +78,94 @@ pub enum TypeBound { } pub struct Struct { - vis: ast::Visibility, - id: NodeId, - struct_type: StructType, - name: Ident, - generics: ast::Generics, - attrs: Vec , - fields: Vec , - where: Span, + pub vis: ast::Visibility, + pub id: NodeId, + pub struct_type: StructType, + pub name: Ident, + pub generics: ast::Generics, + pub attrs: Vec, + pub fields: Vec, + pub where: Span, } pub struct Enum { - vis: ast::Visibility, - variants: Vec , - generics: ast::Generics, - attrs: Vec , - id: NodeId, - where: Span, - name: Ident, + pub vis: ast::Visibility, + pub variants: Vec, + pub generics: ast::Generics, + pub attrs: Vec, + pub id: NodeId, + pub where: Span, + pub name: Ident, } pub struct Variant { - name: Ident, - attrs: Vec , - kind: ast::VariantKind, - id: ast::NodeId, - vis: ast::Visibility, - where: Span, + pub name: Ident, + pub attrs: Vec, + pub kind: ast::VariantKind, + pub id: ast::NodeId, + pub vis: ast::Visibility, + pub where: Span, } pub struct Function { - decl: ast::FnDecl, - attrs: Vec , - id: NodeId, - name: Ident, - vis: ast::Visibility, - purity: ast::Purity, - where: Span, - generics: ast::Generics, + pub decl: ast::FnDecl, + pub attrs: Vec, + pub id: NodeId, + pub name: Ident, + pub vis: ast::Visibility, + pub purity: ast::Purity, + pub where: Span, + pub generics: ast::Generics, } pub struct Typedef { - ty: ast::P, - gen: ast::Generics, - name: Ident, - id: ast::NodeId, - attrs: Vec , - where: Span, - vis: ast::Visibility, + pub ty: ast::P, + pub gen: ast::Generics, + pub name: Ident, + pub id: ast::NodeId, + pub attrs: Vec, + pub where: Span, + pub vis: ast::Visibility, } pub struct Static { - type_: ast::P, - mutability: ast::Mutability, - expr: @ast::Expr, - name: Ident, - attrs: Vec , - vis: ast::Visibility, - id: ast::NodeId, - where: Span, + pub type_: ast::P, + pub mutability: ast::Mutability, + pub expr: @ast::Expr, + pub name: Ident, + pub attrs: Vec, + pub vis: ast::Visibility, + pub id: ast::NodeId, + pub where: Span, } pub struct Trait { - name: Ident, - methods: Vec , //should be TraitMethod - generics: ast::Generics, - parents: Vec , - attrs: Vec , - id: ast::NodeId, - where: Span, - vis: ast::Visibility, + pub name: Ident, + pub methods: Vec, //should be TraitMethod + pub generics: ast::Generics, + pub parents: Vec, + pub attrs: Vec, + pub id: ast::NodeId, + pub where: Span, + pub vis: ast::Visibility, } pub struct Impl { - generics: ast::Generics, - trait_: Option, - for_: ast::P, - methods: Vec<@ast::Method> , - attrs: Vec , - where: Span, - vis: ast::Visibility, - id: ast::NodeId, + pub generics: ast::Generics, + pub trait_: Option, + pub for_: ast::P, + pub methods: Vec<@ast::Method>, + pub attrs: Vec, + pub where: Span, + pub vis: ast::Visibility, + pub id: ast::NodeId, } pub struct Macro { - name: Ident, - id: ast::NodeId, - attrs: Vec , - where: Span, + pub name: Ident, + pub id: ast::NodeId, + pub attrs: Vec, + pub where: Span, } pub fn struct_type_from_def(sd: &ast::StructDef) -> StructType { diff --git a/src/librustdoc/flock.rs b/src/librustdoc/flock.rs index c2524d2b545..9030caed6cd 100644 --- a/src/librustdoc/flock.rs +++ b/src/librustdoc/flock.rs @@ -27,14 +27,14 @@ mod os { use std::libc; pub struct flock { - l_type: libc::c_short, - l_whence: libc::c_short, - l_start: libc::off_t, - l_len: libc::off_t, - l_pid: libc::pid_t, + pub l_type: libc::c_short, + pub l_whence: libc::c_short, + pub l_start: libc::off_t, + pub l_len: libc::off_t, + pub l_pid: libc::pid_t, // not actually here, but brings in line with freebsd - l_sysid: libc::c_int, + pub l_sysid: libc::c_int, } pub static F_WRLCK: libc::c_short = 1; @@ -48,12 +48,12 @@ mod os { use std::libc; pub struct flock { - l_start: libc::off_t, - l_len: libc::off_t, - l_pid: libc::pid_t, - l_type: libc::c_short, - l_whence: libc::c_short, - l_sysid: libc::c_int, + pub l_start: libc::off_t, + pub l_len: libc::off_t, + pub l_pid: libc::pid_t, + pub l_type: libc::c_short, + pub l_whence: libc::c_short, + pub l_sysid: libc::c_int, } pub static F_UNLCK: libc::c_short = 2; @@ -67,14 +67,14 @@ mod os { use std::libc; pub struct flock { - l_start: libc::off_t, - l_len: libc::off_t, - l_pid: libc::pid_t, - l_type: libc::c_short, - l_whence: libc::c_short, + pub l_start: libc::off_t, + pub l_len: libc::off_t, + pub l_pid: libc::pid_t, + pub l_type: libc::c_short, + pub l_whence: libc::c_short, // not actually here, but brings in line with freebsd - l_sysid: libc::c_int, + pub l_sysid: libc::c_int, } pub static F_UNLCK: libc::c_short = 2; @@ -84,7 +84,7 @@ pub struct flock { } pub struct Lock { - priv fd: libc::c_int, + fd: libc::c_int, } impl Lock { @@ -155,7 +155,7 @@ fn UnlockFileEx(hFile: libc::HANDLE, } pub struct Lock { - priv handle: libc::HANDLE, + handle: libc::HANDLE, } impl Lock { diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index b59e29fc0e9..399dcf6991c 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -13,15 +13,15 @@ #[deriving(Clone)] pub struct Layout { - logo: ~str, - favicon: ~str, - krate: ~str, + pub logo: ~str, + pub favicon: ~str, + pub krate: ~str, } pub struct Page<'a> { - title: &'a str, - ty: &'a str, - root_path: &'a str, + pub title: &'a str, + pub ty: &'a str, + pub root_path: &'a str, } pub fn render( diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 3629692e5b0..94b0b21dc9e 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -68,26 +68,26 @@ pub struct Context { /// Current hierarchy of components leading down to what's currently being /// rendered - current: Vec<~str> , + pub current: Vec<~str> , /// String representation of how to get back to the root path of the 'doc/' /// folder in terms of a relative URL. - root_path: ~str, + pub root_path: ~str, /// The current destination folder of where HTML artifacts should be placed. /// This changes as the context descends into the module hierarchy. - dst: Path, + pub dst: Path, /// This describes the layout of each page, and is not modified after /// creation of the context (contains info like the favicon) - layout: layout::Layout, + pub layout: layout::Layout, /// This map is a list of what should be displayed on the sidebar of the /// current page. The key is the section header (traits, modules, /// functions), and the value is the list of containers belonging to this /// header. This map will change depending on the surrounding context of the /// page. - sidebar: HashMap<~str, Vec<~str> >, + pub sidebar: HashMap<~str, Vec<~str> >, /// This flag indicates whether [src] links should be generated or not. If /// the source files are present in the html rendering, then this will be /// `true`. - include_sources: bool, + pub include_sources: bool, } /// Indicates where an external crate can be found. @@ -122,7 +122,7 @@ pub struct Cache { /// Mapping of typaram ids to the name of the type parameter. This is used /// when pretty-printing a type (so pretty printing doesn't have to /// painfully maintain a context like this) - typarams: HashMap, + pub typarams: HashMap, /// Maps a type id to all known implementations for that type. This is only /// recognized for intra-crate `ResolvedPath` types, and is used to print @@ -130,43 +130,43 @@ pub struct Cache { /// /// The values of the map are a list of implementations and documentation /// found on that implementation. - impls: HashMap)> >, + pub impls: HashMap)> >, /// Maintains a mapping of local crate node ids to the fully qualified name /// and "short type description" of that node. This is used when generating /// URLs when a type is being linked to. External paths are not located in /// this map because the `External` type itself has all the information /// necessary. - paths: HashMap , &'static str)>, + pub paths: HashMap , &'static str)>, /// This map contains information about all known traits of this crate. /// Implementations of a crate should inherit the documentation of the /// parent trait if no extra documentation is specified, and default methods /// should show up in documentation about trait implementations. - traits: HashMap, + pub traits: HashMap, /// When rendering traits, it's often useful to be able to list all /// implementors of the trait, and this mapping is exactly, that: a mapping /// of trait ids to the list of known implementors of the trait - implementors: HashMap >, + pub implementors: HashMap >, /// Cache of where external crate documentation can be found. - extern_locations: HashMap, + pub extern_locations: HashMap, // Private fields only used when initially crawling a crate to build a cache - priv stack: Vec<~str> , - priv parent_stack: Vec , - priv search_index: Vec , - priv privmod: bool, - priv public_items: NodeSet, + stack: Vec<~str> , + parent_stack: Vec , + search_index: Vec , + privmod: bool, + public_items: NodeSet, // In rare case where a structure is defined in one module but implemented // in another, if the implementing module is parsed before defining module, // then the fully qualified name of the structure isn't presented in `paths` // yet when its implementation methods are being indexed. Caches such methods // and their parent id here and indexes them at the end of crate parsing. - priv orphan_methods: Vec<(ast::NodeId, clean::Item)>, + orphan_methods: Vec<(ast::NodeId, clean::Item)>, } /// Helper struct to render all source code to HTML pages diff --git a/src/librustdoc/html/toc.rs b/src/librustdoc/html/toc.rs index f8d91fffb1f..afb7f559a80 100644 --- a/src/librustdoc/html/toc.rs +++ b/src/librustdoc/html/toc.rs @@ -26,7 +26,7 @@ pub struct Toc { /// # Main /// ### A /// ## B - priv entries: Vec + entries: Vec } impl Toc { @@ -37,17 +37,17 @@ fn count_entries_with_level(&self, level: u32) -> uint { #[deriving(Eq)] pub struct TocEntry { - priv level: u32, - priv sec_number: ~str, - priv name: ~str, - priv id: ~str, - priv children: Toc, + level: u32, + sec_number: ~str, + name: ~str, + id: ~str, + children: Toc, } /// Progressive construction of a table of contents. #[deriving(Eq)] pub struct TocBuilder { - priv top_level: Toc, + top_level: Toc, /// The current heirachy of parent headings, the levels are /// strictly increasing (i.e. chain[0].level < chain[1].level < /// ...) with each entry being the most recent occurance of a @@ -56,7 +56,7 @@ pub struct TocBuilder { /// the most recent one). /// /// We also have `chain[0].level <= top_level.entries[last]`. - priv chain: Vec + chain: Vec } impl TocBuilder { diff --git a/src/librustdoc/plugins.rs b/src/librustdoc/plugins.rs index 6e0e9f87900..f3a82fead5a 100644 --- a/src/librustdoc/plugins.rs +++ b/src/librustdoc/plugins.rs @@ -19,10 +19,10 @@ /// Manages loading and running of plugins pub struct PluginManager { - priv dylibs: Vec , - priv callbacks: Vec , + dylibs: Vec , + callbacks: Vec , /// The directory plugins will be loaded from - prefix: Path, + pub prefix: Path, } impl PluginManager { diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 64203db83b7..afc01d0eb62 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -190,15 +190,15 @@ fn maketest(s: &str, cratename: &str, loose_feature_gating: bool) -> ~str { } pub struct Collector { - tests: Vec, - priv names: Vec<~str>, - priv libs: HashSet, - priv cnt: uint, - priv use_headers: bool, - priv current_header: Option<~str>, - priv cratename: ~str, - - priv loose_feature_gating: bool + pub tests: Vec, + names: Vec<~str>, + libs: HashSet, + cnt: uint, + use_headers: bool, + current_header: Option<~str>, + cratename: ~str, + + loose_feature_gating: bool } impl Collector { diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 8be3535b3ec..78c6940244c 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -21,10 +21,10 @@ use doctree::*; pub struct RustdocVisitor<'a> { - module: Module, - attrs: Vec , - cx: &'a core::DocContext, - analysis: Option<&'a core::CrateAnalysis>, + pub module: Module, + pub attrs: Vec, + pub cx: &'a core::DocContext, + pub analysis: Option<&'a core::CrateAnalysis>, } impl<'a> RustdocVisitor<'a> { -- GitLab