rustdoc: Don't inject extern crate std.

No need to duplicate the compiler's work!

Closes #14999
This commit is contained in:
Alex Crichton 2014-06-18 01:07:59 -07:00
parent 19260b043b
commit 72c08a4f8f

View File

@ -209,7 +209,9 @@ pub fn maketest(s: &str, cratename: Option<&str>, lints: bool) -> String {
");
}
if !s.contains("extern crate") {
// Don't inject `extern crate std` because it's already injected by the
// compiler.
if !s.contains("extern crate") && cratename != Some("std") {
match cratename {
Some(cratename) => {
if s.contains(cratename) {