-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc: get back missing crate-name when --playground-url is used #37911
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
Conversation
Thanks for the PR, but could you describe what the bug is and how this is fixing it? |
@alexcrichton I've updated the description of the PR. Thank you! |
My concerns from the previous PR still apply #37763 (review). At the very least this feature needs tests. |
This pr simply fixes a bug found in previous pr. |
Yeah I do agree that if we're fixing bugs it's best if we have some tests for this. Could some tests be added to |
Ok, I'll try to add some tests. Maybe need a little more time. |
@liigo you should be able to do something like https://github.com/rust-lang/rust/blob/master/src/test/rustdoc/playground.rs but with @alexcrichton shouldn't new command line options for rustdoc at least start out as unstable? |
Thank you! |
Ah yes actually I forgot that we had unstable options in rustdoc now. Can we make this an unstable option at the same time? |
@alexcrichton Yes, Will do. |
Done. r? @alexcrichton |
@bors: r+ |
📌 Commit ae94007 has been approved by |
⌛ Testing commit ae94007 with merge 80ec92e... |
💔 Test failed - auto-mac-32-opt |
ae94007
to
d5785a3
Compare
updated to pass the tests |
@bors: r+ |
📌 Commit d5785a3 has been approved by |
rustdoc: get back missing crate-name when --playground-url is used follow up PR #37763 r? @alexcrichton (since you r+ed to #37763 ) ---- Edit: When `#![doc(html_playground_url="")]` is used, the current crate name is saved to `PLAYGROUND`, so rustdoc may generate `extern crate NAME;` into code snips automatically. But when `--playground-url` was introduced in PR #37763, I forgot saving crate name to `PLAYGROUND`. This PR fix that. ---- Update: - add test - unstable `--playground-url`
follow up PR #37763
r? @alexcrichton (since you r+ed to #37763 )
Edit: When
#![doc(html_playground_url="")]
is used, the current crate name is saved toPLAYGROUND
, so rustdoc may generateextern crate NAME;
into code snips automatically. But when--playground-url
was introduced in PR #37763, I forgot saving crate name toPLAYGROUND
. This PR fix that.Update:
--playground-url