Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/librustc_save_analysis/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,17 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
result.push_str(&val.as_str());
}
result.push('\n');
} else if let Some(meta_list) = attr.meta_item_list() {
meta_list.into_iter()
.filter(|it| it.check_name("include"))
.filter_map(|it| it.meta_item_list().map(|l| l.to_owned()))
.flat_map(|it| it)
.filter(|meta| meta.check_name("contents"))
.filter_map(|meta| meta.value_str())
.for_each(|val| {
result.push_str(&val.as_str());
result.push('\n');
});
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/test/run-make/save-analysis/extra-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Extra docs for this struct.
4 changes: 4 additions & 0 deletions src/test/run-make/save-analysis/foo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#![feature(box_syntax)]
#![feature(rustc_private)]
#![feature(associated_type_defaults)]
#![feature(external_doc)]

extern crate graphviz;
// A simple rust project
Expand Down Expand Up @@ -461,3 +462,6 @@ impl Iterator for SilenceGenerator {
trait Foo {
type Bar = FrameBuffer;
}

#[doc(include="extra-docs.md")]
struct StructWithDocs;