rustdoc: Don't inject extern crate std
.
No need to duplicate the compiler's work! Closes #14999
This commit is contained in:
parent
19260b043b
commit
72c08a4f8f
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user