Skip to content

Commit 145e023

Browse files
committed
rustdoc: Remove legacy exports
1 parent a27f523 commit 145e023

25 files changed

+102
-213
lines changed

src/librustdoc/astsrv.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,29 @@ use rustc::back::link;
2121
use rustc::metadata::filesearch;
2222
use rustc::front;
2323

24-
export Ctxt;
25-
export CtxtHandler;
26-
export Srv;
27-
export from_str;
28-
export from_file;
29-
export exec;
30-
31-
type Ctxt = {
24+
pub type Ctxt = {
3225
ast: @ast::crate,
3326
ast_map: ast_map::map
3427
};
3528

3629
type SrvOwner<T> = fn(srv: Srv) -> T;
37-
type CtxtHandler<T> = fn~(ctxt: Ctxt) -> T;
30+
pub type CtxtHandler<T> = fn~(ctxt: Ctxt) -> T;
3831
type Parser = fn~(Session, ~str) -> @ast::crate;
3932

4033
enum Msg {
4134
HandleRequest(fn~(Ctxt)),
4235
Exit
4336
}
4437

45-
enum Srv = {
38+
pub enum Srv = {
4639
ch: comm::Chan<Msg>
4740
};
4841

49-
fn from_str<T>(source: ~str, owner: SrvOwner<T>) -> T {
42+
pub fn from_str<T>(source: ~str, owner: SrvOwner<T>) -> T {
5043
run(owner, source, parse::from_str_sess)
5144
}
5245

53-
fn from_file<T>(file: ~str, owner: SrvOwner<T>) -> T {
46+
pub fn from_file<T>(file: ~str, owner: SrvOwner<T>) -> T {
5447
run(owner, file, |sess, f| parse::from_file_sess(sess, &Path(f)))
5548
}
5649

@@ -88,7 +81,7 @@ fn act(po: comm::Port<Msg>, source: ~str, parse: Parser) {
8881
}
8982
}
9083

91-
fn exec<T:Send>(
84+
pub fn exec<T:Send>(
9285
srv: Srv,
9386
+f: fn~(ctxt: Ctxt) -> T
9487
) -> T {

src/librustdoc/attr_parser.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ use syntax::ast;
99
use syntax::attr;
1010
use core::tuple;
1111

12-
export CrateAttrs;
13-
export parse_crate, parse_desc;
14-
export parse_hidden;
15-
16-
type CrateAttrs = {
12+
pub type CrateAttrs = {
1713
name: Option<~str>
1814
};
1915

@@ -48,7 +44,7 @@ fn doc_metas(
4844
return doc_metas;
4945
}
5046

51-
fn parse_crate(attrs: ~[ast::attribute]) -> CrateAttrs {
47+
pub fn parse_crate(attrs: ~[ast::attribute]) -> CrateAttrs {
5248
let link_metas = attr::find_linkage_metas(attrs);
5349

5450
{
@@ -80,7 +76,7 @@ fn should_not_extract_crate_name_if_no_name_value_in_link_attribute() {
8076
assert attrs.name == None;
8177
}
8278

83-
fn parse_desc(attrs: ~[ast::attribute]) -> Option<~str> {
79+
pub fn parse_desc(attrs: ~[ast::attribute]) -> Option<~str> {
8480
let doc_strs = do doc_metas(attrs).filter_map |meta| {
8581
attr::get_meta_item_value_str(*meta)
8682
};
@@ -107,7 +103,7 @@ fn parse_desc_should_parse_simple_doc_attributes() {
107103
assert attrs == Some(~"basic");
108104
}
109105

110-
fn parse_hidden(attrs: ~[ast::attribute]) -> bool {
106+
pub fn parse_hidden(attrs: ~[ast::attribute]) -> bool {
111107
do doc_metas(attrs).find |meta| {
112108
match attr::get_meta_item_list(meta) {
113109
Some(metas) => {

src/librustdoc/attr_pass.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ use syntax::ast;
1212
use syntax::ast_map;
1313
use std::map::HashMap;
1414

15-
export mk_pass;
16-
17-
fn mk_pass() -> Pass {
15+
pub fn mk_pass() -> Pass {
1816
{
1917
name: ~"attr",
2018
f: run

src/librustdoc/config.rs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
use result::Result;
22
use std::getopts;
33

4-
export OutputFormat;
5-
export OutputStyle;
6-
export Config;
7-
export default_config;
8-
export parse_config;
9-
export usage;
10-
export Markdown, PandocHtml;
11-
export DocPerCrate, DocPerMod;
12-
134
/// The type of document to output
14-
enum OutputFormat {
5+
pub enum OutputFormat {
156
/// Markdown
16-
Markdown,
7+
pub Markdown,
178
/// HTML, via markdown and pandoc
18-
PandocHtml
9+
pub PandocHtml
1910
}
2011

2112
impl OutputFormat : cmp::Eq {
@@ -36,11 +27,11 @@ impl OutputFormat : cmp::Eq {
3627
}
3728

3829
/// How to organize the output
39-
enum OutputStyle {
30+
pub enum OutputStyle {
4031
/// All in a single document
41-
DocPerCrate,
32+
pub DocPerCrate,
4233
/// Each module in its own document
43-
DocPerMod
34+
pub DocPerMod
4435
}
4536

4637
impl OutputStyle : cmp::Eq {
@@ -61,7 +52,7 @@ impl OutputStyle : cmp::Eq {
6152
}
6253

6354
/// The configuration for a rustdoc session
64-
type Config = {
55+
pub type Config = {
6556
input_crate: Path,
6657
output_dir: Path,
6758
output_format: OutputFormat,
@@ -90,7 +81,7 @@ fn opts() -> ~[(getopts::Opt, ~str)] {
9081
]
9182
}
9283

93-
fn usage() {
84+
pub fn usage() {
9485
use io::println;
9586

9687
println(~"Usage: rustdoc [options] <cratefile>\n");
@@ -101,7 +92,7 @@ fn usage() {
10192
println(~"");
10293
}
10394

104-
fn default_config(input_crate: &Path) -> Config {
95+
pub fn default_config(input_crate: &Path) -> Config {
10596
{
10697
input_crate: *input_crate,
10798
output_dir: Path("."),

src/librustdoc/desc_to_brief_pass.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ is interpreted as the brief description.
77

88
use doc::ItemUtils;
99

10-
export mk_pass;
11-
12-
fn mk_pass() -> Pass {
10+
pub fn mk_pass() -> Pass {
1311
{
1412
name: ~"desc_to_brief",
1513
f: run

src/librustdoc/doc.rs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! The document model
22
3-
type AstId = int;
3+
pub type AstId = int;
44

5-
type Doc_ = {
5+
pub type Doc_ = {
66
pages: ~[Page]
77
};
88

@@ -23,7 +23,7 @@ impl Doc_ : cmp::Eq {
2323
pure fn ne(&self, other: &Doc_) -> bool { !(*self).eq(other) }
2424
}
2525

26-
enum Doc {
26+
pub enum Doc {
2727
Doc_(Doc_)
2828
}
2929

@@ -40,7 +40,7 @@ impl Doc : cmp::Eq {
4040
pure fn ne(&self, other: &Doc) -> bool { *(*self) != *(*other) }
4141
}
4242

43-
enum Page {
43+
pub enum Page {
4444
CratePage(CrateDoc),
4545
ItemPage(ItemTag)
4646
}
@@ -88,7 +88,7 @@ impl Page : cmp::Eq {
8888
pure fn ne(&self, other: &Page) -> bool { !(*self).eq(other) }
8989
}
9090

91-
enum Implementation {
91+
pub enum Implementation {
9292
Required,
9393
Provided,
9494
}
@@ -115,7 +115,7 @@ impl Implementation : cmp::Eq {
115115
* Most rustdocs can be parsed into 'sections' according to their markdown
116116
* headers
117117
*/
118-
type Section = {
118+
pub type Section = {
119119
header: ~str,
120120
body: ~str
121121
};
@@ -140,7 +140,7 @@ impl Section : cmp::Eq {
140140
// FIXME (#2596): We currently give topmod the name of the crate. There
141141
// would probably be fewer special cases if the crate had its own name
142142
// and topmod's name was the empty string.
143-
type CrateDoc = {
143+
pub type CrateDoc = {
144144
topmod: ModDoc,
145145
};
146146

@@ -161,7 +161,7 @@ impl CrateDoc : cmp::Eq {
161161
pure fn ne(&self, other: &CrateDoc) -> bool { !(*self).eq(other) }
162162
}
163163

164-
enum ItemTag {
164+
pub enum ItemTag {
165165
ModTag(ModDoc),
166166
NmodTag(NmodDoc),
167167
ConstTag(ConstDoc),
@@ -300,7 +300,7 @@ impl ItemTag : cmp::Eq {
300300
pure fn ne(&self, other: &ItemTag) -> bool { !(*self).eq(other) }
301301
}
302302

303-
type ItemDoc = {
303+
pub type ItemDoc = {
304304
id: AstId,
305305
name: ~str,
306306
path: ~[~str],
@@ -340,7 +340,7 @@ impl ItemDoc : cmp::Eq {
340340
pure fn ne(&self, other: &ItemDoc) -> bool { !(*self).eq(other) }
341341
}
342342

343-
type SimpleItemDoc = {
343+
pub type SimpleItemDoc = {
344344
item: ItemDoc,
345345
sig: Option<~str>
346346
};
@@ -362,7 +362,7 @@ impl SimpleItemDoc : cmp::Eq {
362362
pure fn ne(&self, other: &SimpleItemDoc) -> bool { !(*self).eq(other) }
363363
}
364364

365-
type ModDoc_ = {
365+
pub type ModDoc_ = {
366366
item: ItemDoc,
367367
items: ~[ItemTag],
368368
index: Option<Index>
@@ -389,7 +389,7 @@ impl ModDoc_ : cmp::Eq {
389389
pure fn ne(&self, other: &ModDoc_) -> bool { !(*self).eq(other) }
390390
}
391391

392-
enum ModDoc {
392+
pub enum ModDoc {
393393
ModDoc_(ModDoc_)
394394
}
395395

@@ -406,7 +406,7 @@ impl ModDoc : cmp::Eq {
406406
pure fn ne(&self, other: &ModDoc) -> bool { *(*self) != *(*other) }
407407
}
408408

409-
type NmodDoc = {
409+
pub type NmodDoc = {
410410
item: ItemDoc,
411411
fns: ~[FnDoc],
412412
index: Option<Index>
@@ -433,11 +433,11 @@ impl NmodDoc : cmp::Eq {
433433
pure fn ne(&self, other: &NmodDoc) -> bool { !(*self).eq(other) }
434434
}
435435

436-
type ConstDoc = SimpleItemDoc;
436+
pub type ConstDoc = SimpleItemDoc;
437437

438-
type FnDoc = SimpleItemDoc;
438+
pub type FnDoc = SimpleItemDoc;
439439

440-
type EnumDoc = {
440+
pub type EnumDoc = {
441441
item: ItemDoc,
442442
variants: ~[VariantDoc]
443443
};
@@ -459,7 +459,7 @@ impl EnumDoc : cmp::Eq {
459459
pure fn ne(&self, other: &EnumDoc) -> bool { !(*self).eq(other) }
460460
}
461461

462-
type VariantDoc = {
462+
pub type VariantDoc = {
463463
name: ~str,
464464
desc: Option<~str>,
465465
sig: Option<~str>
@@ -486,7 +486,7 @@ impl VariantDoc : cmp::Eq {
486486
pure fn ne(&self, other: &VariantDoc) -> bool { !(*self).eq(other) }
487487
}
488488

489-
type TraitDoc = {
489+
pub type TraitDoc = {
490490
item: ItemDoc,
491491
methods: ~[MethodDoc]
492492
};
@@ -508,7 +508,7 @@ impl TraitDoc : cmp::Eq {
508508
pure fn ne(&self, other: &TraitDoc) -> bool { !(*self).eq(other) }
509509
}
510510

511-
type MethodDoc = {
511+
pub type MethodDoc = {
512512
name: ~str,
513513
brief: Option<~str>,
514514
desc: Option<~str>,
@@ -544,7 +544,7 @@ impl MethodDoc : cmp::Eq {
544544
pure fn ne(&self, other: &MethodDoc) -> bool { !(*self).eq(other) }
545545
}
546546

547-
type ImplDoc = {
547+
pub type ImplDoc = {
548548
item: ItemDoc,
549549
trait_types: ~[~str],
550550
self_ty: Option<~str>,
@@ -574,9 +574,9 @@ impl ImplDoc : cmp::Eq {
574574
pure fn ne(&self, other: &ImplDoc) -> bool { !(*self).eq(other) }
575575
}
576576

577-
type TyDoc = SimpleItemDoc;
577+
pub type TyDoc = SimpleItemDoc;
578578

579-
type StructDoc = {
579+
pub type StructDoc = {
580580
item: ItemDoc,
581581
fields: ~[~str],
582582
sig: Option<~str>
@@ -603,7 +603,7 @@ impl StructDoc : cmp::Eq {
603603
pure fn ne(&self, other: &StructDoc) -> bool { !(*self).eq(other) }
604604
}
605605

606-
type Index = {
606+
pub type Index = {
607607
entries: ~[IndexEntry]
608608
};
609609

@@ -634,7 +634,7 @@ impl Index : cmp::Eq {
634634
* * brief - The brief description
635635
* * link - A format-specific string representing the link target
636636
*/
637-
type IndexEntry = {
637+
pub type IndexEntry = {
638638
kind: ~str,
639639
name: ~str,
640640
brief: Option<~str>,
@@ -764,7 +764,7 @@ impl ModDoc {
764764
}
765765
}
766766

767-
trait PageUtils {
767+
pub trait PageUtils {
768768
fn mods() -> ~[ModDoc];
769769
fn nmods() -> ~[NmodDoc];
770770
fn fns() -> ~[FnDoc];
@@ -850,7 +850,7 @@ impl ~[Page]: PageUtils {
850850
}
851851
}
852852

853-
trait Item {
853+
pub trait Item {
854854
pure fn item() -> ItemDoc;
855855
}
856856

@@ -898,7 +898,7 @@ impl StructDoc: Item {
898898
pure fn item() -> ItemDoc { self.item }
899899
}
900900

901-
trait ItemUtils {
901+
pub trait ItemUtils {
902902
pure fn id() -> AstId;
903903
pure fn name() -> ~str;
904904
pure fn path() -> ~[~str];

0 commit comments

Comments
 (0)