Skip to content

Commit e959fab

Browse files
committed
Auto merge of #24597 - bombless:doc, r=steveklabnik
This patch will make links like http://doc.rust-lang.org/std/collections/struct.BTreeMap.html#examples actually playable without modifying the code. It seems that this patch cannot be tested on test/rustdoc. And I suggest adding a `&run=1` to those links. Thank @jorisgio for noticing me this! r? @steveklabnik Closes #24332
2 parents be9a72b + adc93ce commit e959fab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustdoc/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ pub fn maketest(s: &str, cratename: Option<&str>, dont_insert_main: bool,
277277

278278
// Don't inject `extern crate std` because it's already injected by the
279279
// compiler.
280-
if !s.contains("extern crate") && !opts.no_crate_inject {
280+
if !s.contains("extern crate") && !opts.no_crate_inject && cratename != Some("std") {
281281
match cratename {
282282
Some(cratename) => {
283283
if s.contains(cratename) {

0 commit comments

Comments
 (0)