Skip to content

Commit 22de23e

Browse files
add crates to the final doctest
1 parent dd8fc7d commit 22de23e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustdoc/test.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ pub fn make_test(s: &str,
395395
// Now push any outer attributes from the example, assuming they
396396
// are intended to be crate attributes.
397397
prog.push_str(&crate_attrs);
398+
prog.push_str(&crates);
398399

399400
// Uses libsyntax to parse the doctest and find if there's a main fn and the extern
400401
// crate already is included.
@@ -488,6 +489,8 @@ pub fn make_test(s: &str,
488489
prog.push_str("\n}");
489490
}
490491

492+
debug!("final doctest:\n{}", prog);
493+
491494
(prog, line_offset)
492495
}
493496

0 commit comments

Comments
 (0)