rustdoc: don't inject "extern crate std;"

This commit is contained in:
York Xiang 2015-04-19 18:10:45 +08:00
parent b08d6cf529
commit adc93ceac9

View File

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