Skip to content

Commit c1b6af7

Browse files
committed
---
yaml --- r: 7898 b: refs/heads/snap-stage3 c: 95e2b1b h: refs/heads/master v: v3
1 parent 94f8cdc commit c1b6af7

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 2898dcc5d97da9427ac367542382b6239d9c0bbf
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: d56a4dd04bf6fc3017f32cd4a6b4375c52e66a9c
4+
refs/heads/snap-stage3: 95e2b1b8f91c3381b9b02b53a544a5f35eb2c853
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/snap-stage3/src/rustdoc/prune_unexported_pass.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ fn exported_items_from(
138138
vec::filter_map(doc.items) { |itemtag|
139139
let name = alt itemtag {
140140
doc::enumtag(~{name, _}) { name }
141-
doc::restag(~{name, _}) { "FIXME" }
141+
doc::restag(~{name, _}) { name }
142142
};
143143
let itemtag = alt itemtag {
144144
doc::enumtag(enumdoc) {
@@ -332,3 +332,21 @@ fn should_prune_unexported_variants() {
332332
let doc = run(srv, doc);
333333
assert vec::len(doc.topmod.mods[0].enums()[0].variants) == 0u;
334334
}
335+
336+
#[test]
337+
fn should_prune_unexported_resources_from_top_mod() {
338+
let source = "export a; mod a { } resource r(a: bool) { }";
339+
let srv = astsrv::mk_srv_from_str(source);
340+
let doc = extract::from_srv(srv, "");
341+
let doc = run(srv, doc);
342+
assert vec::is_empty(doc.topmod.resources());
343+
}
344+
345+
#[test]
346+
fn should_prune_unexported_resources() {
347+
let source = "mod a { export a; mod a { } resource r(a: bool) { } }";
348+
let srv = astsrv::mk_srv_from_str(source);
349+
let doc = extract::from_srv(srv, "");
350+
let doc = run(srv, doc);
351+
assert vec::is_empty(doc.topmod.mods[0].resources());
352+
}

0 commit comments

Comments
 (0)