Skip to content

Commit b3d6597

Browse files
move manual "extern crate" statements outside auto "fn main" in doctests
1 parent 5313e87 commit b3d6597

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustdoc/test.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,8 @@ fn partition_source(s: &str) -> (String, String) {
417417
for line in s.lines() {
418418
let trimline = line.trim();
419419
let header = trimline.is_whitespace() ||
420-
trimline.starts_with("#![");
420+
trimline.starts_with("#![") ||
421+
trimline.starts_with("extern crate");
421422
if !header || after_header {
422423
after_header = true;
423424
after.push_str(line);
@@ -858,8 +859,8 @@ use asdf::qwop;
858859
assert_eq!(2+2, 4);";
859860
let expected =
860861
"#![allow(unused)]
861-
fn main() {
862862
extern crate asdf;
863+
fn main() {
863864
use asdf::qwop;
864865
assert_eq!(2+2, 4);
865866
}".to_string();

0 commit comments

Comments
 (0)