-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add --no-source option flag to rustdoc #75522
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @jyn514 |
Looks reasonable to me. I don't have a strong opinion on whether this should be insta-stable, but since it's just exposing an option that already exists through the command line I don't see why not. |
Forgot to write it down but if we go stable: I'll also need to add the related documentation too. |
8f1f613
to
8e23b49
Compare
Added the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me after nits are fixed
8e23b49
to
a867bd9
Compare
@bors: r=jyn514 |
📌 Commit a867bd9a5389caa854103fd20221e2de354eaaa8 has been approved by |
@bors r- New features require at least an FCP. An issue with |
It's not a new feature, that's why I asked if it required to go through an unstable phase since it's only providing a command-line flag for an already stable attribute. So this is a different issue in my opinion: this PR is about adding a command-line flag for a stable attribute. If the attribute itself has issues, then it should be fixed in another PR. What do you think @ollie27 ? |
Triage: What's the status here? |
ping @ollie27 |
a867bd9
to
edd318e
Compare
Fixed conflicts and fixed issues reported by @camelid ! |
edd318e
to
9a191fe
Compare
☔ The latest upstream changes (presumably #83790) made this pull request unmergeable. Please resolve the merge conflicts. |
9a191fe
to
d92f875
Compare
This comment has been minimized.
This comment has been minimized.
d92f875
to
6b16940
Compare
To be honest I'm not sure what do here. As mentioned in #75497 (comment) you can already get the effect of The guidelines for command-line arguments in rustc explicitly recommend not using the As well as not rendering source files for the current crate,
As far as I'm concerned, a new command line argument is a new feature no matter how simple it may appear so I would expect to see at least an FCP for it.
The attribute can be fixed but the command line argument can't. rustdoc will have no way of knowing if an external crate has been documented with |
☔ The latest upstream changes (presumably #83857) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm pretty sure we never generate
That's fair. Also, we should maybe go through a period of "nightly only" and then propose to stabilize it. So here what I suggest: I make this unstable for the time being, and open another PR to stabilize it with an FCP. What do you think?
I'm not sure to understand your concern over this: we can already use an external URL to say where the external crate is supposed to be and we have no idea if it has been generated with source code or not. Also, like said above, we don't generate |
I think Ollie's point is that, for the attribute, we can tell when the crate will never have docs and stop generating links to it. If someone passes --extern-html-root-url they're guaranteeing that the URL does in fact have docs at it, it's not rustdoc's responsibility. I don't have a strong opinion on this either way, but given that there are already a ton of ways to replicate this already (e.g. --crate-attr html_no_source), are you sure there needs to be a dedicated flag? Most attributes aren't duplicated in flags. |
That argument doesn't work since, like you said, we can reach the same result using
This is mostly for convenience, it's easier to use an explicit argument rather than going through attributes. I'd personally prefer to add this option (obviously) but I'll let it up to the team for the final decision. |
No, like Ollie said earlier, rustdoc should stop generating links to source when it knows they won't exist: #55957 I'm not sure who "the team" is (do you want to ping more people?) but given all the discussion here I'd prefer not to add this, rustdoc has a ton of knobs already and this one doesn't seem particularly useful. |
By the team I meant ours. 😉 And fine by me! Let's close this then. :) |
Fixes #75497.
A question though: should we go through an unstable phase or not considering the attribute is already stable?