Skip to content

Commit eb08e8f

Browse files
committed
rustdoc: Switch field privacy as necessary
1 parent f0ee509 commit eb08e8f

File tree

10 files changed

+259
-251
lines changed

10 files changed

+259
-251
lines changed

src/librustdoc/clean.rs

Lines changed: 106 additions & 98 deletions
Large diffs are not rendered by default.

src/librustdoc/core.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ pub enum MaybeTyped {
3232
}
3333

3434
pub struct DocContext {
35-
krate: ast::Crate,
36-
maybe_typed: MaybeTyped
35+
pub krate: ast::Crate,
36+
pub maybe_typed: MaybeTyped
3737
}
3838

3939
impl DocContext {
@@ -46,8 +46,8 @@ impl DocContext {
4646
}
4747

4848
pub struct CrateAnalysis {
49-
exported_items: privacy::ExportedItems,
50-
public_items: privacy::PublicItems,
49+
pub exported_items: privacy::ExportedItems,
50+
pub public_items: privacy::PublicItems,
5151
}
5252

5353
/// Parses, resolves, and typechecks the given crate

src/librustdoc/doctree.rs

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ use syntax::ast;
1717
use syntax::ast::{Ident, NodeId};
1818

1919
pub struct Module {
20-
name: Option<Ident>,
21-
attrs: Vec<ast::Attribute> ,
22-
where: Span,
23-
structs: Vec<Struct> ,
24-
enums: Vec<Enum> ,
25-
fns: Vec<Function> ,
26-
mods: Vec<Module> ,
27-
id: NodeId,
28-
typedefs: Vec<Typedef> ,
29-
statics: Vec<Static> ,
30-
traits: Vec<Trait> ,
31-
vis: ast::Visibility,
32-
impls: Vec<Impl> ,
33-
foreigns: Vec<ast::ForeignMod> ,
34-
view_items: Vec<ast::ViewItem> ,
35-
macros: Vec<Macro> ,
36-
is_crate: bool,
20+
pub name: Option<Ident>,
21+
pub attrs: Vec<ast::Attribute>,
22+
pub where: Span,
23+
pub structs: Vec<Struct>,
24+
pub enums: Vec<Enum>,
25+
pub fns: Vec<Function>,
26+
pub mods: Vec<Module>,
27+
pub id: NodeId,
28+
pub typedefs: Vec<Typedef>,
29+
pub statics: Vec<Static>,
30+
pub traits: Vec<Trait>,
31+
pub vis: ast::Visibility,
32+
pub impls: Vec<Impl>,
33+
pub foreigns: Vec<ast::ForeignMod>,
34+
pub view_items: Vec<ast::ViewItem>,
35+
pub macros: Vec<Macro>,
36+
pub is_crate: bool,
3737
}
3838

3939
impl Module {
@@ -78,94 +78,94 @@ pub enum TypeBound {
7878
}
7979

8080
pub struct Struct {
81-
vis: ast::Visibility,
82-
id: NodeId,
83-
struct_type: StructType,
84-
name: Ident,
85-
generics: ast::Generics,
86-
attrs: Vec<ast::Attribute> ,
87-
fields: Vec<ast::StructField> ,
88-
where: Span,
81+
pub vis: ast::Visibility,
82+
pub id: NodeId,
83+
pub struct_type: StructType,
84+
pub name: Ident,
85+
pub generics: ast::Generics,
86+
pub attrs: Vec<ast::Attribute>,
87+
pub fields: Vec<ast::StructField>,
88+
pub where: Span,
8989
}
9090

9191
pub struct Enum {
92-
vis: ast::Visibility,
93-
variants: Vec<Variant> ,
94-
generics: ast::Generics,
95-
attrs: Vec<ast::Attribute> ,
96-
id: NodeId,
97-
where: Span,
98-
name: Ident,
92+
pub vis: ast::Visibility,
93+
pub variants: Vec<Variant>,
94+
pub generics: ast::Generics,
95+
pub attrs: Vec<ast::Attribute>,
96+
pub id: NodeId,
97+
pub where: Span,
98+
pub name: Ident,
9999
}
100100

101101
pub struct Variant {
102-
name: Ident,
103-
attrs: Vec<ast::Attribute> ,
104-
kind: ast::VariantKind,
105-
id: ast::NodeId,
106-
vis: ast::Visibility,
107-
where: Span,
102+
pub name: Ident,
103+
pub attrs: Vec<ast::Attribute>,
104+
pub kind: ast::VariantKind,
105+
pub id: ast::NodeId,
106+
pub vis: ast::Visibility,
107+
pub where: Span,
108108
}
109109

110110
pub struct Function {
111-
decl: ast::FnDecl,
112-
attrs: Vec<ast::Attribute> ,
113-
id: NodeId,
114-
name: Ident,
115-
vis: ast::Visibility,
116-
purity: ast::Purity,
117-
where: Span,
118-
generics: ast::Generics,
111+
pub decl: ast::FnDecl,
112+
pub attrs: Vec<ast::Attribute>,
113+
pub id: NodeId,
114+
pub name: Ident,
115+
pub vis: ast::Visibility,
116+
pub purity: ast::Purity,
117+
pub where: Span,
118+
pub generics: ast::Generics,
119119
}
120120

121121
pub struct Typedef {
122-
ty: ast::P<ast::Ty>,
123-
gen: ast::Generics,
124-
name: Ident,
125-
id: ast::NodeId,
126-
attrs: Vec<ast::Attribute> ,
127-
where: Span,
128-
vis: ast::Visibility,
122+
pub ty: ast::P<ast::Ty>,
123+
pub gen: ast::Generics,
124+
pub name: Ident,
125+
pub id: ast::NodeId,
126+
pub attrs: Vec<ast::Attribute>,
127+
pub where: Span,
128+
pub vis: ast::Visibility,
129129
}
130130

131131
pub struct Static {
132-
type_: ast::P<ast::Ty>,
133-
mutability: ast::Mutability,
134-
expr: @ast::Expr,
135-
name: Ident,
136-
attrs: Vec<ast::Attribute> ,
137-
vis: ast::Visibility,
138-
id: ast::NodeId,
139-
where: Span,
132+
pub type_: ast::P<ast::Ty>,
133+
pub mutability: ast::Mutability,
134+
pub expr: @ast::Expr,
135+
pub name: Ident,
136+
pub attrs: Vec<ast::Attribute>,
137+
pub vis: ast::Visibility,
138+
pub id: ast::NodeId,
139+
pub where: Span,
140140
}
141141

142142
pub struct Trait {
143-
name: Ident,
144-
methods: Vec<ast::TraitMethod> , //should be TraitMethod
145-
generics: ast::Generics,
146-
parents: Vec<ast::TraitRef> ,
147-
attrs: Vec<ast::Attribute> ,
148-
id: ast::NodeId,
149-
where: Span,
150-
vis: ast::Visibility,
143+
pub name: Ident,
144+
pub methods: Vec<ast::TraitMethod>, //should be TraitMethod
145+
pub generics: ast::Generics,
146+
pub parents: Vec<ast::TraitRef>,
147+
pub attrs: Vec<ast::Attribute>,
148+
pub id: ast::NodeId,
149+
pub where: Span,
150+
pub vis: ast::Visibility,
151151
}
152152

153153
pub struct Impl {
154-
generics: ast::Generics,
155-
trait_: Option<ast::TraitRef>,
156-
for_: ast::P<ast::Ty>,
157-
methods: Vec<@ast::Method> ,
158-
attrs: Vec<ast::Attribute> ,
159-
where: Span,
160-
vis: ast::Visibility,
161-
id: ast::NodeId,
154+
pub generics: ast::Generics,
155+
pub trait_: Option<ast::TraitRef>,
156+
pub for_: ast::P<ast::Ty>,
157+
pub methods: Vec<@ast::Method>,
158+
pub attrs: Vec<ast::Attribute>,
159+
pub where: Span,
160+
pub vis: ast::Visibility,
161+
pub id: ast::NodeId,
162162
}
163163

164164
pub struct Macro {
165-
name: Ident,
166-
id: ast::NodeId,
167-
attrs: Vec<ast::Attribute> ,
168-
where: Span,
165+
pub name: Ident,
166+
pub id: ast::NodeId,
167+
pub attrs: Vec<ast::Attribute>,
168+
pub where: Span,
169169
}
170170

171171
pub fn struct_type_from_def(sd: &ast::StructDef) -> StructType {

src/librustdoc/flock.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ mod imp {
2727
use std::libc;
2828

2929
pub struct flock {
30-
l_type: libc::c_short,
31-
l_whence: libc::c_short,
32-
l_start: libc::off_t,
33-
l_len: libc::off_t,
34-
l_pid: libc::pid_t,
30+
pub l_type: libc::c_short,
31+
pub l_whence: libc::c_short,
32+
pub l_start: libc::off_t,
33+
pub l_len: libc::off_t,
34+
pub l_pid: libc::pid_t,
3535

3636
// not actually here, but brings in line with freebsd
37-
l_sysid: libc::c_int,
37+
pub l_sysid: libc::c_int,
3838
}
3939

4040
pub static F_WRLCK: libc::c_short = 1;
@@ -48,12 +48,12 @@ mod imp {
4848
use std::libc;
4949

5050
pub struct flock {
51-
l_start: libc::off_t,
52-
l_len: libc::off_t,
53-
l_pid: libc::pid_t,
54-
l_type: libc::c_short,
55-
l_whence: libc::c_short,
56-
l_sysid: libc::c_int,
51+
pub l_start: libc::off_t,
52+
pub l_len: libc::off_t,
53+
pub l_pid: libc::pid_t,
54+
pub l_type: libc::c_short,
55+
pub l_whence: libc::c_short,
56+
pub l_sysid: libc::c_int,
5757
}
5858

5959
pub static F_UNLCK: libc::c_short = 2;
@@ -67,14 +67,14 @@ mod imp {
6767
use std::libc;
6868

6969
pub struct flock {
70-
l_start: libc::off_t,
71-
l_len: libc::off_t,
72-
l_pid: libc::pid_t,
73-
l_type: libc::c_short,
74-
l_whence: libc::c_short,
70+
pub l_start: libc::off_t,
71+
pub l_len: libc::off_t,
72+
pub l_pid: libc::pid_t,
73+
pub l_type: libc::c_short,
74+
pub l_whence: libc::c_short,
7575

7676
// not actually here, but brings in line with freebsd
77-
l_sysid: libc::c_int,
77+
pub l_sysid: libc::c_int,
7878
}
7979

8080
pub static F_UNLCK: libc::c_short = 2;
@@ -84,7 +84,7 @@ mod imp {
8484
}
8585

8686
pub struct Lock {
87-
priv fd: libc::c_int,
87+
fd: libc::c_int,
8888
}
8989

9090
impl Lock {
@@ -155,7 +155,7 @@ mod imp {
155155
}
156156

157157
pub struct Lock {
158-
priv handle: libc::HANDLE,
158+
handle: libc::HANDLE,
159159
}
160160

161161
impl Lock {

src/librustdoc/html/layout.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ use std::io;
1313

1414
#[deriving(Clone)]
1515
pub struct Layout {
16-
logo: ~str,
17-
favicon: ~str,
18-
krate: ~str,
16+
pub logo: ~str,
17+
pub favicon: ~str,
18+
pub krate: ~str,
1919
}
2020

2121
pub struct Page<'a> {
22-
title: &'a str,
23-
ty: &'a str,
24-
root_path: &'a str,
22+
pub title: &'a str,
23+
pub ty: &'a str,
24+
pub root_path: &'a str,
2525
}
2626

2727
pub fn render<T: fmt::Show, S: fmt::Show>(

0 commit comments

Comments
 (0)