add files loaded through doc(include) into dep-info
This commit is contained in:
parent
8fc0d47581
commit
95b87d18c0
4 changed files with 11 additions and 1 deletions
|
@ -1120,6 +1120,10 @@ impl<'a, 'b> Folder for InvocationCollector<'a, 'b> {
|
|||
|
||||
match String::from_utf8(buf) {
|
||||
Ok(src) => {
|
||||
// Add this input file to the code map to make it available as
|
||||
// dependency information
|
||||
self.cx.codemap().new_filemap_and_lines(&filename, &src);
|
||||
|
||||
let include_info = vec![
|
||||
dummy_spanned(ast::NestedMetaItemKind::MetaItem(
|
||||
attr::mk_name_value_item_str("file".into(),
|
||||
|
|
|
@ -8,7 +8,7 @@ ifneq ($(shell uname),FreeBSD)
|
|||
ifndef IS_WINDOWS
|
||||
all:
|
||||
$(RUSTC) --emit dep-info main.rs
|
||||
$(CGREP) "input.txt" "input.bin" < $(TMPDIR)/main.d
|
||||
$(CGREP) "input.txt" "input.bin" "input.md" < $(TMPDIR)/main.d
|
||||
else
|
||||
all:
|
||||
|
||||
|
|
1
src/test/run-make/include_bytes_deps/input.md
Normal file
1
src/test/run-make/include_bytes_deps/input.md
Normal file
|
@ -0,0 +1 @@
|
|||
# Hello, world!
|
|
@ -8,6 +8,11 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(external_doc)]
|
||||
|
||||
#[doc(include="input.md")]
|
||||
pub struct SomeStruct;
|
||||
|
||||
pub fn main() {
|
||||
const INPUT_TXT: &'static str = include_str!("input.txt");
|
||||
const INPUT_BIN: &'static [u8] = include_bytes!("input.bin");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue