-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc: don't inject "extern crate std;" #24597
Conversation
This should fix #24332 as well |
Yes. |
@bors: r+ |
📌 Commit adc93ce has been approved by |
⌛ Testing commit adc93ce with merge e959fab... |
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
When I click on the playpen link in the example, I land up here: https://play.rust-lang.org/?code=extern%20crate%20std%3B%0Afn%20main()%20%7B%0A%20%20%20%20use%20std%3A%3Acollections%3A%3ABTreeMap%3B%0A%20%20%20%20%0A%20%20%20%20let%20mut%20a%20%3D%20BTreeMap%3A%3Anew()%3B%0A%20%20%20%20a.insert(1%2C%20%22a%22)%3B%0A%20%20%20%20a.clear()%3B%0A%20%20%20%20assert!(a.is_empty())%3B%0A%20%20%20%20%0A%7D And this fails with this error:
|
@achanda this was just merged four hours ago, you won't be able to see the changes till tomorrow :) |
oh :) thanks @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