diff options
Diffstat (limited to 'src/rustdoc/path_pass.rs')
| -rw-r--r-- | src/rustdoc/path_pass.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/rustdoc/path_pass.rs b/src/rustdoc/path_pass.rs index 8589e3264e0..737c7419084 100644 --- a/src/rustdoc/path_pass.rs +++ b/src/rustdoc/path_pass.rs @@ -47,7 +47,11 @@ fn fold_nmod(fold: fold::fold<ctxt>, doc: doc::nmoddoc) -> doc::nmoddoc { vec::push(fold.ctxt.path, doc.name()); let doc = fold::default_seq_fold_nmod(fold, doc); vec::pop(fold.ctxt.path); - ret doc; + + { + item: fold.fold_item(fold, doc.item) + with doc + } } #[test] @@ -72,6 +76,16 @@ fn should_record_fn_paths() { } #[test] +fn should_record_native_mod_paths() { + let source = "mod a { native mod b { } }"; + astsrv::from_str(source) {|srv| + let doc = extract::from_srv(srv, ""); + let doc = run(srv, doc); + assert doc.topmod.mods()[0].nmods()[0].path() == ["a"]; + } +} + +#[test] fn should_record_native_fn_paths() { let source = "native mod a { fn b(); }"; astsrv::from_str(source) {|srv| |
