Skip to content

Commit c775798

Browse files
committed
rustdoc: Add a test that unexported ifaces are pruned
1 parent cb4a383 commit c775798

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/rustdoc/prune_unexported_pass.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,12 @@ fn should_prune_unexported_resources() {
235235
let doc = run(srv, doc);
236236
assert vec::is_empty(doc.topmod.mods()[0].resources());
237237
}
238+
239+
#[test]
240+
fn should_prune_unexported_ifaces_from_top_mod() {
241+
let source = "export a; mod a { } iface b { fn c(); }";
242+
let srv = astsrv::mk_srv_from_str(source);
243+
let doc = extract::from_srv(srv, "");
244+
let doc = run(srv, doc);
245+
assert vec::is_empty(doc.topmod.ifaces());
246+
}

0 commit comments

Comments
 (0)