Skip to content
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

Tracking issue for rustdoc deprecations/cleanup #44136

Closed
3 tasks
steveklabnik opened this issue Aug 28, 2017 · 7 comments
Closed
3 tasks

Tracking issue for rustdoc deprecations/cleanup #44136

steveklabnik opened this issue Aug 28, 2017 · 7 comments
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@steveklabnik
Copy link
Member

steveklabnik commented Aug 28, 2017

In a recent @rust-lang/dev-tools meeting, we chatted about some compatibility issues with rustdoc. A lot of rustdoc was never really strongly thought-through, or there were grand plans that never really materialized.

As such, we want to deprecate and then remove some things that we don't believe anyone is using, and provide better support for some things people are doing, but in a hacky way.

Summary of plans, to be checked off as they're done:

  • --input-format/--output-format
  • --plugin-path/--plugins
  • --no-defaults/--passes

More details below.

In addition, when it's closer to ship the new rustdoc, the various HTML and CSS flags will probably be replaced by a real templating system, and so we'll need to introduce some messaging there. That's not part of this ticket, however.

--input-format/--output-format

These flags are completely ignored today. Originally there were big plans, but not anymore.

These should be deprecated and hidden from the docs.

NOTE: As of September 2020 this is no longer true, see #76578 for --output-format json.

--plugin-path/--plugins

Rustdoc supports plugins, who knew? The approach here is plagued with problems; dynamic library loading, exposing internal rustdoc types, no real guarantees. We're not aware of anyone even using this functionality.

These should be deprecated, and eventually, the functionality should be removed.

--no-defaults/--passes

These flags have one known use today: to document private items by removing all passes, and then sending in the passes that don't strip private items.

We should deprecate these flags, and eventually remove the functionality, however, this should not be done without adding a new flag, to be named, to just actually generate private docs.

@steveklabnik steveklabnik added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Aug 28, 2017
steveklabnik added a commit to steveklabnik/rust that referenced this issue Aug 28, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Aug 29, 2017
…r=Manishearth

Deprecate several flags in rustdoc

Part of rust-lang#44136

cc @rust-lang/dev-tools @rust-lang/docs

This is a very basic PR to start deprecating some flags; `rustdoc` doesn't really have fancy output options like `rustc` does, so I went with `eprintln!`. Happy to change it if people feel that's not appropriate.

Also, I have no idea if we can or should write tests here, so I didn't try. If someone feels strongly about it, then let's do it, but given that the only outcome here is a side effect...
frewsxcv added a commit to frewsxcv/rust that referenced this issue Aug 29, 2017
…r=Manishearth

Deprecate several flags in rustdoc

Part of rust-lang#44136

cc @rust-lang/dev-tools @rust-lang/docs

This is a very basic PR to start deprecating some flags; `rustdoc` doesn't really have fancy output options like `rustc` does, so I went with `eprintln!`. Happy to change it if people feel that's not appropriate.

Also, I have no idea if we can or should write tests here, so I didn't try. If someone feels strongly about it, then let's do it, but given that the only outcome here is a side effect...
steveklabnik added a commit to steveklabnik/rust that referenced this issue Oct 17, 2017
kennytm added a commit to kennytm/rust that referenced this issue Oct 18, 2017
…r=QuietMisdreavus

Deprecate several flags in rustdoc

Part of rust-lang#44136

cc @rust-lang/dev-tools @rust-lang/docs

This is a very basic PR to start deprecating some flags; `rustdoc` doesn't really have fancy output options like `rustc` does, so I went with `eprintln!`. Happy to change it if people feel that's not appropriate.

Also, I have no idea if we can or should write tests here, so I didn't try. If someone feels strongly about it, then let's do it, but given that the only outcome here is a side effect...
kennytm added a commit to kennytm/rust that referenced this issue May 16, 2018
…=GuillaumeGomez

rustdoc: deprecate `#![doc(passes, plugins, no_default_passes)]`

Closes rust-lang#48164

Blocked on rust-lang#50541 - this includes those changes, which were necessary to create the UI test

cc rust-lang#44136

Turns out, there were special attributes to mess with rustdoc passes and plugins! Who knew! Since we deprecated the CLI flags for this functionality, it makes sense that we do the same for the attributes.

This PR also introduces a `#![doc(document_private_items)]` attribute, to match the `--document-private-items` flag introduced in rust-lang#44138 when the passes/plugins flags were deprecated.

I haven't done a search to see whether these attributes are being used at all, but if the flags were any indication, i don't expect to see any users of these.
@BartMassey
Copy link
Contributor

I occasionally document a Rust binary crate with this:

cargo rustdoc --open -- --no-defaults \
  --passes collapse-docs   \
  --passes unindent-comments \
  --passes strip-priv-imports

These days I get a warning about deprecated flags per this issue.

I can use the incantation below instead, but that isn't quite the same: there's a "Re-exports" section tacked on the front page that arguably doesn't make much sense for a binary crate.

cargo rustdoc --open -- --document-private-items

@jonas-schievink
Copy link
Contributor

Yeah this really should imply --passes strip-priv-imports. Private imports are just visual noise even when I'm interested in the guts of the crate I work on.

@QuietMisdreavus
Copy link
Member

strip-priv-imports was added to the default private passes in #52751.

@jonas-schievink
Copy link
Contributor

@QuietMisdreavus Great, thanks!

@araspik
Copy link

araspik commented Feb 25, 2019

So there is no way to get JSON output or similar for documentation purposes? I wanted to hack together an info file creator (shell script or something) but it seems that -w json no longer works.

@QuietMisdreavus
Copy link
Member

Correct, HTML is the only available output format for rustdoc right now. We are planning on re-introducing JSON output this year, but work on that has not yet started.

@GuillaumeGomez
Copy link
Member

I'll *soon* though.

jyn514 added a commit to jyn514/rust that referenced this issue Apr 6, 2021
- Don't treat it as deprecated on stable and beta channels. Before, it
  would give confusing and incorrect output:

  ```
  warning: the 'output-format' flag is considered deprecated
    |
    = warning: see issue rust-lang#44136 <rust-lang#44136> for more information

  error: json output format isn't supported for doc generation
  ```
  Both of those are wrong: output-format isn't deprecated, and json
  output is supported.

- Require -Z unstable-options for `--output-format json`

  Previously, it was allowed by default on nightly, which made it hard
  to realize the flag wouldn't be accepted on beta or stable.
  Note that this still allows `--output-format html`, which has been
  stable since 1.0.

- Remove unnecessary double-checking of the feature gate when parsing
  the output format
- Add custom run-make test since compiletest passes -Zunstable-options
    by default
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Apr 7, 2021
Fix handling of `--output-format json` flag

- Don't treat it as deprecated on stable and beta channels. Before, it
  would give confusing and incorrect output:

  ```
  warning: the 'output-format' flag is considered deprecated
    |
    = warning: see issue rust-lang#44136 <rust-lang#44136> for more information

  error: json output format isn't supported for doc generation
  ```
  Both of those are wrong: output-format isn't deprecated, and json
  output is supported.

- Require -Z unstable-options for `--output-format json`

  Previously, it was allowed by default on nightly, which made it hard
  to realize the flag wouldn't be accepted on beta or stable.

To get the test working I had to remove `-Z unstable-options`, which x.py passed to compiletest unconditionally. It was first added in rust-lang@8c2ec68 so `-Z miri` would be allowed. -Z miri is no longer passed unconditionally, so hopefully removing it won't break anything.

r? `@aDotInTheVoid` cc `@HeroicKatora` `@CraftSpider`

Thanks to `@memoryruins` for pointing it out on Discord!

cc `@Mark-Simulacrum` for the change to compiletest.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Apr 7, 2021
Fix handling of `--output-format json` flag

- Don't treat it as deprecated on stable and beta channels. Before, it
  would give confusing and incorrect output:

  ```
  warning: the 'output-format' flag is considered deprecated
    |
    = warning: see issue rust-lang#44136 <rust-lang#44136> for more information

  error: json output format isn't supported for doc generation
  ```
  Both of those are wrong: output-format isn't deprecated, and json
  output is supported.

- Require -Z unstable-options for `--output-format json`

  Previously, it was allowed by default on nightly, which made it hard
  to realize the flag wouldn't be accepted on beta or stable.

To get the test working I had to remove `-Z unstable-options`, which x.py passed to compiletest unconditionally. It was first added in rust-lang@8c2ec68 so `-Z miri` would be allowed. -Z miri is no longer passed unconditionally, so hopefully removing it won't break anything.

r? ``@aDotInTheVoid`` cc ``@HeroicKatora`` ``@CraftSpider``

Thanks to ``@memoryruins`` for pointing it out on Discord!

cc ``@Mark-Simulacrum`` for the change to compiletest.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Apr 7, 2021
Fix handling of `--output-format json` flag

- Don't treat it as deprecated on stable and beta channels. Before, it
  would give confusing and incorrect output:

  ```
  warning: the 'output-format' flag is considered deprecated
    |
    = warning: see issue rust-lang#44136 <rust-lang#44136> for more information

  error: json output format isn't supported for doc generation
  ```
  Both of those are wrong: output-format isn't deprecated, and json
  output is supported.

- Require -Z unstable-options for `--output-format json`

  Previously, it was allowed by default on nightly, which made it hard
  to realize the flag wouldn't be accepted on beta or stable.

To get the test working I had to remove `-Z unstable-options`, which x.py passed to compiletest unconditionally. It was first added in rust-lang@8c2ec68 so `-Z miri` would be allowed. -Z miri is no longer passed unconditionally, so hopefully removing it won't break anything.

r? ```@aDotInTheVoid``` cc ```@HeroicKatora``` ```@CraftSpider```

Thanks to ```@memoryruins``` for pointing it out on Discord!

cc ```@Mark-Simulacrum``` for the change to compiletest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants