rustdoc: Prune unexported impls

This commit is contained in:
Brian Anderson 2012-01-31 16:09:27 -08:00
parent 7d6cf37a8d
commit c218b65fd8
2 changed files with 10 additions and 1 deletions

View file

@ -184,7 +184,7 @@ impl util for itemtag {
doc::enumtag({name, _}) { name }
doc::restag({name, _}) { name }
doc::ifacetag({name, _}) { name }
_ { fail }
doc::impltag({name, _}) { name }
}
}
}

View file

@ -248,3 +248,12 @@ fn should_prune_unexported_ifaces_from_top_mod() {
let doc = run(srv, doc);
assert vec::is_empty(doc.topmod.ifaces());
}
#[test]
fn should_prune_unexported_impls_from_top_mod() {
let source = "export a; mod a { } impl b for int { fn c() { } }";
let srv = astsrv::mk_srv_from_str(source);
let doc = extract::from_srv(srv, "");
let doc = run(srv, doc);
assert vec::is_empty(doc.topmod.impls())
}