add crates to the final doctest
This commit is contained in:
parent
dd8fc7dc06
commit
22de23e303
1 changed files with 3 additions and 0 deletions
|
|
@ -395,6 +395,7 @@ pub fn make_test(s: &str,
|
|||
// Now push any outer attributes from the example, assuming they
|
||||
// are intended to be crate attributes.
|
||||
prog.push_str(&crate_attrs);
|
||||
prog.push_str(&crates);
|
||||
|
||||
// Uses libsyntax to parse the doctest and find if there's a main fn and the extern
|
||||
// crate already is included.
|
||||
|
|
@ -488,6 +489,8 @@ pub fn make_test(s: &str,
|
|||
prog.push_str("\n}");
|
||||
}
|
||||
|
||||
debug!("final doctest:\n{}", prog);
|
||||
|
||||
(prog, line_offset)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue