Skip to content

Commit b7b00b5

Browse files
committed
---
yaml --- r: 10934 b: refs/heads/master c: acb11f4 h: refs/heads/master v: v3
1 parent 28f3e7c commit b7b00b5

File tree

4 files changed

+44
-6
lines changed

4 files changed

+44
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 56db37d4c7fea8085f80783d1f3dc3204fcfc0b6
2+
refs/heads/master: acb11f47dc7b7fb03caeee5ade2c7002cb20cb6f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rustdoc/doc.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ enum itemtag {
1212
fntag(fndoc),
1313
enumtag(enumdoc),
1414
restag(resdoc),
15-
ifacetag(ifacedoc)
15+
ifacetag(ifacedoc),
16+
impltag(impldoc)
1617
}
1718

1819
type moddoc = {
@@ -96,6 +97,16 @@ type methoddoc = {
9697
sig: option<str>
9798
};
9899

100+
type impldoc = {
101+
id: ast_id,
102+
name: str,
103+
brief: option<str>,
104+
desc: option<str>,
105+
iface_ty: option<str>,
106+
for_ty: option<str>,
107+
methods: [methoddoc]
108+
};
109+
99110
#[doc = "Some helper methods on moddoc, mostly for testing"]
100111
impl util for moddoc {
101112

@@ -152,6 +163,15 @@ impl util for moddoc {
152163
}
153164
}
154165
}
166+
167+
fn impls() -> [impldoc] {
168+
vec::filter_map(*self.items) {|itemtag|
169+
alt itemtag {
170+
impltag(impldoc) { some(impldoc) }
171+
_ { none }
172+
}
173+
}
174+
}
155175
}
156176

157177
#[doc = "Helper methods on itemtag"]
@@ -164,6 +184,7 @@ impl util for itemtag {
164184
doc::enumtag({name, _}) { name }
165185
doc::restag({name, _}) { name }
166186
doc::ifacetag({name, _}) { name }
187+
_ { fail }
167188
}
168189
}
169190
}

trunk/src/rustdoc/fold.rs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default_seq_fold_const;
1111
export default_seq_fold_enum;
1212
export default_seq_fold_res;
1313
export default_seq_fold_iface;
14+
export default_seq_fold_impl;
1415

1516
enum fold<T> = t<T>;
1617

@@ -21,6 +22,7 @@ type fold_const<T> = fn~(fold: fold<T>, doc: doc::constdoc) -> doc::constdoc;
2122
type fold_enum<T> = fn~(fold: fold<T>, doc: doc::enumdoc) -> doc::enumdoc;
2223
type fold_res<T> = fn~(fold: fold<T>, doc: doc::resdoc) -> doc::resdoc;
2324
type fold_iface<T> = fn~(fold: fold<T>, doc: doc::ifacedoc) -> doc::ifacedoc;
25+
type fold_impl<T> = fn~(fold: fold<T>, doc: doc::impldoc) -> doc::impldoc;
2426

2527
type t<T> = {
2628
ctxt: T,
@@ -30,7 +32,8 @@ type t<T> = {
3032
fold_const: fold_const<T>,
3133
fold_enum: fold_enum<T>,
3234
fold_res: fold_res<T>,
33-
fold_iface: fold_iface<T>
35+
fold_iface: fold_iface<T>,
36+
fold_impl: fold_impl<T>
3437
};
3538

3639

@@ -44,7 +47,8 @@ fn mk_fold<T:copy>(
4447
fold_const: fold_const<T>,
4548
fold_enum: fold_enum<T>,
4649
fold_res: fold_res<T>,
47-
fold_iface: fold_iface<T>
50+
fold_iface: fold_iface<T>,
51+
fold_impl: fold_impl<T>
4852
) -> fold<T> {
4953
fold({
5054
ctxt: ctxt,
@@ -54,7 +58,8 @@ fn mk_fold<T:copy>(
5458
fold_const: fold_const,
5559
fold_enum: fold_enum,
5660
fold_res: fold_res,
57-
fold_iface: fold_iface
61+
fold_iface: fold_iface,
62+
fold_impl: fold_impl
5863
})
5964
}
6065

@@ -67,7 +72,8 @@ fn default_seq_fold<T:copy>(ctxt: T) -> fold<T> {
6772
{|f, d| default_seq_fold_const(f, d)},
6873
{|f, d| default_seq_fold_enum(f, d)},
6974
{|f, d| default_seq_fold_res(f, d)},
70-
{|f, d| default_seq_fold_iface(f, d)}
75+
{|f, d| default_seq_fold_iface(f, d)},
76+
{|f, d| default_seq_fold_impl(f, d)}
7177
)
7278
}
7379

@@ -105,6 +111,9 @@ fn default_seq_fold_mod<T>(
105111
doc::ifacetag(ifacedoc) {
106112
doc::ifacetag(fold.fold_iface(fold, ifacedoc))
107113
}
114+
doc::impltag(impldoc) {
115+
doc::impltag(fold.fold_impl(fold, impldoc))
116+
}
108117
}
109118
}
110119
with doc
@@ -146,6 +155,13 @@ fn default_seq_fold_iface<T>(
146155
doc
147156
}
148157

158+
fn default_seq_fold_impl<T>(
159+
_fold: fold<T>,
160+
doc: doc::impldoc
161+
) -> doc::impldoc {
162+
doc
163+
}
164+
149165
#[test]
150166
fn default_fold_should_produce_same_doc() {
151167
let source = "mod a { fn b() { } mod c { fn d() { } } }";

trunk/src/rustdoc/markdown_pass.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ fn write_mod_contents(
138138
doc::enumtag(enumdoc) { write_enum(ctxt, enumdoc) }
139139
doc::restag(resdoc) { write_res(ctxt, resdoc) }
140140
doc::ifacetag(ifacedoc) { write_iface(ctxt, ifacedoc) }
141+
doc::impltag(impldoc) { fail }
141142
}
142143
}
143144
}

0 commit comments

Comments
 (0)