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

Improve Rustdoc's handling of procedural macros #62855

Merged
merged 2 commits into from
Aug 29, 2019

Conversation

Aaron1011
Copy link
Member

@Aaron1011 Aaron1011 commented Jul 21, 2019

Fixes #58700
Fixes #58696
Fixes #49553
Fixes #52210

This commit removes the special rustdoc handling for proc macros, as we can now
retrieve their span and attributes just like any other item.

A new command-line option is added to rustdoc: --crate-type. This takes the same options as rustc's --crate-type option. However, all values other than proc-macro are treated the same. This allows Rustdoc to enable 'proc macro mode' when handling a proc macro crate.

In compiletest, a new 'rustdoc-flags' option is added. This allows us to
pass in the '--proc-macro-crate' flag in the absence of Cargo.

I've opened an additional PR to Cargo to support passing in this flag.
These two PRS can be merged in any order - the Cargo changes will not
take effect until the 'cargo' submodule is updated in this repository.

@petrochenkov petrochenkov added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 21, 2019
@petrochenkov
Copy link
Contributor

@Aaron1011
Could you split the pub use change into a separate PR?
It's orthogonal to the proc macro stuff and may require a different kind of approval.
(I'll start reading the proc macro part after that, it may end up being a long story.)

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 22, 2019
@bors
Copy link
Contributor

bors commented Jul 27, 2019

☔ The latest upstream changes (presumably #62086) made this pull request unmergeable. Please resolve the merge conflicts.

@Aaron1011 Aaron1011 force-pushed the feature/rustdoc-reexport-final branch from fd5d16d to 892b81f Compare July 27, 2019 16:56
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-07-27T16:57:20.0698590Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-07-27T16:57:20.0875945Z ##[command]git config gc.auto 0
2019-07-27T16:57:20.0945215Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-07-27T16:57:20.1002612Z ##[command]git config --get-all http.proxy
2019-07-27T16:57:20.1130654Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/62855/merge:refs/remotes/pull/62855/merge
---
2019-07-27T16:57:52.9930332Z do so (now or later) by using -b with the checkout command again. Example:
2019-07-27T16:57:52.9930502Z 
2019-07-27T16:57:52.9930797Z   git checkout -b <new-branch-name>
2019-07-27T16:57:52.9931237Z 
2019-07-27T16:57:52.9931383Z HEAD is now at a3c144a3b Merge 892b81f2001194973e3c88e1959a45457dadb0ac into 0e9b465d729d07101b29b4d096d83edf9be82df0
2019-07-27T16:57:53.0081491Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-07-27T16:57:53.0084224Z ==============================================================================
2019-07-27T16:57:53.0084305Z Task         : Bash
2019-07-27T16:57:53.0084516Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-07-27T17:54:55.3329620Z .................................................................................................... 700/5870
2019-07-27T17:54:59.1258035Z .................................................................................................... 800/5870
2019-07-27T17:55:04.2545862Z .................................................................................................... 900/5870
2019-07-27T17:55:09.1135425Z .................................................................................................... 1000/5870
2019-07-27T17:55:14.2246693Z i...........i....................................................................................... 1100/5870
2019-07-27T17:55:17.9245900Z ..............................iiiii................................................................. 1200/5870
2019-07-27T17:55:23.4359525Z .................................................................................................... 1400/5870
2019-07-27T17:55:25.8775956Z .................................................................................................... 1500/5870
2019-07-27T17:55:29.3379459Z .................................................................................................... 1600/5870
2019-07-27T17:55:31.8200903Z .................................................................................................... 1700/5870
---
2019-07-27T17:56:41.0408046Z .................................................................................................... 3400/5870
2019-07-27T17:56:45.7685867Z .................................................................................................... 3500/5870
2019-07-27T17:56:49.4376053Z ..........................i.....................................................F................... 3600/5870
2019-07-27T17:56:53.5625671Z .................................................................................................... 3700/5870
2019-07-27T17:56:56.9085508Z ....ii...i..ii...................................................................................... 3800/5870
2019-07-27T17:57:05.2894751Z .................................................................................................... 4000/5870
2019-07-27T17:57:08.8912927Z .......................ii........................................................................... 4100/5870
2019-07-27T17:57:11.0243491Z ............................................i....................................................... 4200/5870
2019-07-27T17:57:12.9131784Z .................................................................................................... 4300/5870
---
2019-07-27T17:58:30.2050690Z diff of stderr:
2019-07-27T17:58:30.2051385Z 
2019-07-27T17:58:30.2052331Z 18   --> $DIR/same-sequence-span.rs:20:1
2019-07-27T17:58:30.2053098Z 19    |
2019-07-27T17:58:30.2053799Z 20 LL | proc_macro_sequence::make_foo!();
2019-07-27T17:58:30.2054755Z -    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not allowed after `expr` fragments
2019-07-27T17:58:30.2056660Z +    | |
2019-07-27T17:58:30.2056660Z +    | |
2019-07-27T17:58:30.2057644Z +    | not allowed after `expr` fragments
2019-07-27T17:58:30.2058512Z +    | in this macro invocation
2019-07-27T17:58:30.2061281Z 22    |
2019-07-27T17:58:30.2061506Z 23    = note: allowed there are: `=>`, `,` or `;`
2019-07-27T17:58:30.2061722Z 
2019-07-27T17:58:30.2062387Z 26   --> $DIR/same-sequence-span.rs:20:1
2019-07-27T17:58:30.2062548Z 27    |
2019-07-27T17:58:30.2062548Z 27    |
2019-07-27T17:58:30.2062656Z 28 LL | proc_macro_sequence::make_foo!();
2019-07-27T17:58:30.2063018Z -    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not allowed after `expr` fragments
2019-07-27T17:58:30.2063268Z +    | |
2019-07-27T17:58:30.2063268Z +    | |
2019-07-27T17:58:30.2063389Z +    | not allowed after `expr` fragments
2019-07-27T17:58:30.2063492Z +    | in this macro invocation
2019-07-27T17:58:30.2063594Z 30    |
2019-07-27T17:58:30.2063717Z 31    = note: allowed there are: `=>`, `,` or `;`
2019-07-27T17:58:30.2063904Z 
2019-07-27T17:58:30.2064227Z 
2019-07-27T17:58:30.2064338Z The actual stderr differed from the expected stderr.
2019-07-27T17:58:30.2065017Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/same-sequence-span/same-sequence-span.stderr
2019-07-27T17:58:30.2065017Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/same-sequence-span/same-sequence-span.stderr
2019-07-27T17:58:30.2065433Z To update references, rerun the tests and pass the `--bless` flag
2019-07-27T17:58:30.2065803Z To only update this specific test, also pass `--test-args macros/same-sequence-span.rs`
2019-07-27T17:58:30.2066066Z error: 1 errors occurred comparing output.
2019-07-27T17:58:30.2066879Z status: exit code: 1
2019-07-27T17:58:30.2066879Z status: exit code: 1
2019-07-27T17:58:30.2067887Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/macros/same-sequence-span.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/same-sequence-span" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/same-sequence-span/auxiliary" "-A" "unused"
2019-07-27T17:58:30.2068517Z ------------------------------------------
2019-07-27T17:58:30.2068673Z 
2019-07-27T17:58:30.2069175Z ------------------------------------------
2019-07-27T17:58:30.2069412Z stderr:
2019-07-27T17:58:30.2069412Z stderr:
2019-07-27T17:58:30.2069802Z ------------------------------------------
2019-07-27T17:58:30.2070141Z error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fragments
2019-07-27T17:58:30.2070630Z    |
2019-07-27T17:58:30.2070630Z    |
2019-07-27T17:58:30.2070761Z LL |     (1 $x:expr $($y:tt,)*   //~ERROR `$x:expr` may be followed by `$y:tt`
2019-07-27T17:58:30.2070872Z    |                  ^^^^^ not allowed after `expr` fragments
2019-07-27T17:58:30.2070975Z    |
2019-07-27T17:58:30.2071097Z    = note: allowed there are: `=>`, `,` or `;`
2019-07-27T17:58:30.2071414Z 
2019-07-27T17:58:30.2071565Z error: `$x:expr` may be followed by `=`, which is not allowed for `expr` fragments
2019-07-27T17:58:30.2072683Z    |
2019-07-27T17:58:30.2072683Z    |
2019-07-27T17:58:30.2072828Z LL |                $(= $z:tt)*  //~ERROR `$x:expr` may be followed by `=`
2019-07-27T17:58:30.2072967Z    |                  ^ not allowed after `expr` fragments
2019-07-27T17:58:30.2073067Z    |
2019-07-27T17:58:30.2073374Z    = note: allowed there are: `=>`, `,` or `;`
2019-07-27T17:58:30.2073516Z 
2019-07-27T17:58:30.2073948Z error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fragments
2019-07-27T17:58:30.2074913Z    |
2019-07-27T17:58:30.2074913Z    |
2019-07-27T17:58:30.2075033Z LL | proc_macro_sequence::make_foo!(); //~ERROR `$x:expr` may be followed by `$y:tt`
2019-07-27T17:58:30.2076031Z    | |
2019-07-27T17:58:30.2076031Z    | |
2019-07-27T17:58:30.2076972Z    | not allowed after `expr` fragments
2019-07-27T17:58:30.2077150Z    | in this macro invocation
2019-07-27T17:58:30.2077280Z    |
2019-07-27T17:58:30.2077410Z    = note: allowed there are: `=>`, `,` or `;`
2019-07-27T17:58:30.2077522Z 
2019-07-27T17:58:30.2077692Z error: `$x:expr` may be followed by `=`, which is not allowed for `expr` fragments
2019-07-27T17:58:30.2078388Z    |
2019-07-27T17:58:30.2078388Z    |
2019-07-27T17:58:30.2078528Z LL | proc_macro_sequence::make_foo!(); //~ERROR `$x:expr` may be followed by `$y:tt`
2019-07-27T17:58:30.2078806Z    | |
2019-07-27T17:58:30.2078806Z    | |
2019-07-27T17:58:30.2078954Z    | not allowed after `expr` fragments
2019-07-27T17:58:30.2079087Z    | in this macro invocation
2019-07-27T17:58:30.2079239Z    |
2019-07-27T17:58:30.2079368Z    = note: allowed there are: `=>`, `,` or `;`
2019-07-27T17:58:30.2079951Z error: aborting due to 4 previous errors
2019-07-27T17:58:30.2080042Z 
2019-07-27T17:58:30.2080127Z 
2019-07-27T17:58:30.2080452Z ------------------------------------------
---
2019-07-27T17:58:30.2082208Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:535:22
2019-07-27T17:58:30.2082363Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-07-27T17:58:30.2082481Z 
2019-07-27T17:58:30.2082569Z 
2019-07-27T17:58:30.2084082Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-07-27T17:58:30.2084548Z 
2019-07-27T17:58:30.2084639Z 
2019-07-27T17:58:30.2086467Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-07-27T17:58:30.2086701Z Build completed unsuccessfully in 0:53:18
2019-07-27T17:58:30.2086701Z Build completed unsuccessfully in 0:53:18
2019-07-27T17:58:31.3911823Z ##[error]Bash exited with code '1'.
2019-07-27T17:58:31.3946637Z ##[section]Starting: Checkout
2019-07-27T17:58:31.3948279Z ==============================================================================
2019-07-27T17:58:31.3948345Z Task         : Get sources
2019-07-27T17:58:31.3948383Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

Aaron1011 added a commit to Aaron1011/rust that referenced this pull request Jul 27, 2019
Split off from rust-lang#62855

Currently, rustdoc ignores any doc comments found on 'pub use'
statements. As described in issue rust-lang#58700, this makes it impossible to
properly document procedural macros. Any doc comments must be written on
the procedural macro definition, which must occur in a dedicated
proc-macro crate. This means that any doc comments or doc tests cannot
reference items defined in re-exporting crate, despite the fact that
such items may be required to use the procedural macro.

To solve this issue, this commit allows doc comments to be written on
'pub use' statements. For consistency, this applies to *all* 'pub use'
statements, not just those importing procedural macros.

When inlining documentation, documentation on 'pub use' statements will
be prepended to the documentation of the inlined item. For example,
the following items:

```rust

mod other_mod {
    /// Doc comment from definition
    pub struct MyStruct;
}

/// Doc comment from 'pub use'
///
pub use other_mod::MyStruct;
```

will caues the documentation for the re-export of 'MyStruct' to be
rendered as:

```
Doc comment from 'pub use'
Doc comment from definition
```

Note the empty line in the 'pub use' doc comments - because doc comments
are concatenated as-is, this ensure that the doc comments on the
definition start on a new line.
@Aaron1011
Copy link
Member Author

@petrochenkov: I've split the pub use changes into a new pull request, as you requested.

@Aaron1011
Copy link
Member Author

Note that due to changes in the metadata format, you should run ./x.py clean when switching to/from this branch locally. This is only a problem when building locally, because the version string will always be <version>-dev

@bors
Copy link
Contributor

bors commented Jul 28, 2019

☔ The latest upstream changes (presumably #63057) made this pull request unmergeable. Please resolve the merge conflicts.

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 28, 2019
@Aaron1011 Aaron1011 force-pushed the feature/rustdoc-reexport-final branch from e2efa77 to cbea48c Compare July 28, 2019 15:29
@petrochenkov
Copy link
Contributor

petrochenkov commented Jul 30, 2019

(@Aaron1011, if you have time, could you squash the commits to entirely remove traces of #63048 from this PR.

I have a few busy days, but hope to return to this PR this week.)

@petrochenkov
Copy link
Contributor

cc @eddyb, especially regarding the metadata bits.

@bors
Copy link
Contributor

bors commented Aug 3, 2019

☔ The latest upstream changes (presumably #63234) made this pull request unmergeable. Please resolve the merge conflicts.

@Aaron1011 Aaron1011 force-pushed the feature/rustdoc-reexport-final branch from cbea48c to ef755fc Compare August 4, 2019 02:13
bors added a commit that referenced this pull request Aug 4, 2019
…laumeGomez

Use doc comments from 'pub use' statements

Split off from #62855

Currently, rustdoc ignores any doc comments found on 'pub use'
statements. As described in issue #58700, this makes it impossible to
properly document procedural macros. Any doc comments must be written on
the procedural macro definition, which must occur in a dedicated
proc-macro crate. This means that any doc comments or doc tests cannot
reference items defined in re-exporting crate, despite the fact that
such items may be required to use the procedural macro.

To solve this issue, this commit allows doc comments to be written on
'pub use' statements. For consistency, this applies to *all* 'pub use'
statements, not just those importing procedural macros.

When inlining documentation, documentation on 'pub use' statements will
be prepended to the documentation of the inlined item. For example,
the following items:

```rust

mod other_mod {
    /// Doc comment from definition
    pub struct MyStruct;
}

/// Doc comment from 'pub use'
///
pub use other_mod::MyStruct;
```

will caues the documentation for the re-export of 'MyStruct' to be
rendered as:

```
Doc comment from 'pub use'
Doc comment from definition
```

Note the empty line in the 'pub use' doc comments - because doc comments
are concatenated as-is, this ensure that the doc comments on the
definition start on a new line.
@petrochenkov
Copy link
Contributor

Ok, let's do the next thing.

  • Move the part of this PR not touching rustdoc or compiletest into a separate PR.
    Rustdoc is not the only consumer of the metadata from proc macro definitions.

    Tests can be written that make sure that 1) the definition span is correct and available from other crates 2) attributes like #[allow_internal_unstable], #[allow_internal_unsafe], #[unstable], #[deprecated] work when applied to proc macro definitions.

  • Assign that PR to @eddyb.
    Representation of proc macros in the metadata is the key part of the problem and I need eddyb's help with that.

    Right now I feel like the PR as implemented introduces technical debt into all the parts of the compiler that it touches. Perhaps if the metadata representation is right and stored/loaded at the right time from the right structures then it won't happen.

This is an important problem to solve and I'm glad someone is working on it, thanks.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 4, 2019
@Aaron1011 Aaron1011 force-pushed the feature/rustdoc-reexport-final branch from ef755fc to e38ddc4 Compare August 4, 2019 21:09
@Aaron1011
Copy link
Member Author

Also, this PR should be r-'d, as it's going to fail.

@Centril
Copy link
Contributor

Centril commented Aug 25, 2019

Failed in #63864 (comment), @bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 25, 2019
@Centril
Copy link
Contributor

Centril commented Aug 25, 2019

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 25, 2019
…e-type proc-macro'

Add a test to make sure that this works
@Aaron1011
Copy link
Member Author

@petrochenkov: As discussed in rust-lang/cargo#7159, I've modified this PR to support documenting proc-macro crates when --crate-type rustdoc is not passed. However, we now emit a warning to let people who manually invoke rustdoc know that they should add the --crate-type proc-macro flag.

This PR should now be ready to merge.

@Aaron1011
Copy link
Member Author

@rustbot modify labels to +S-waiting-on-review, -S-waiting-on-bors

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 28, 2019
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Aug 28, 2019

📌 Commit 4c3e386 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 28, 2019
@bors
Copy link
Contributor

bors commented Aug 29, 2019

⌛ Testing commit 4c3e386 with merge 3476543...

bors added a commit that referenced this pull request Aug 29, 2019
…trochenkov

Improve Rustdoc's handling of procedural macros

Fixes #58700
Fixes #58696
Fixes #49553
Fixes #52210

This commit removes the special rustdoc handling for proc macros, as we can now
retrieve their span and attributes just like any other item.

A new command-line option is added to rustdoc: `--crate-type`. This takes the same options as rustc's `--crate-type` option. However, all values other than `proc-macro` are treated the same. This allows Rustdoc to enable 'proc macro mode' when handling a proc macro crate.

In compiletest, a new 'rustdoc-flags' option is added. This allows us to
pass in the '--proc-macro-crate' flag in the absence of Cargo.

I've opened [an additional PR to Cargo](rust-lang/cargo#7159) to support passing in this flag.
These two PRS can be merged in any order - the Cargo changes will not
take effect until the 'cargo' submodule is updated in this repository.
@bors
Copy link
Contributor

bors commented Aug 29, 2019

☀️ Test successful - checks-azure
Approved by: petrochenkov
Pushing 3476543 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 29, 2019
@bors bors merged commit 4c3e386 into rust-lang:master Aug 29, 2019
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #62855!

Tested on commit 3476543.
Direct link to PR: #62855

💔 rustc-guide on linux: test-pass → test-fail (cc @mark-i-m @spastorino @amanjeev, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Aug 29, 2019
Tested on commit rust-lang/rust@3476543.
Direct link to PR: <rust-lang/rust#62855>

💔 rustc-guide on linux: test-pass → test-fail (cc @mark-i-m @spastorino @amanjeev, @rust-lang/infra).
bors added a commit to rust-lang/cargo that referenced this pull request Sep 16, 2019
…lexcrichton

Pass --crate-type to rustdoc

This supports the [corresponding rustc PR](rust-lang/rust#62855). To enable rustdoc to properly
document macros, we pass a new flag '--proc-macro-crate' when
documenting a proc-macro crate. This causes rustdoc to enable the
proc-macro compiler logic that runs when rustc is building a proc-macro
crate.

This flag is essentially a more restricted version of
'--crate-type=proc-macro'. I didn't think it was necessary to pass the
full '--crate-type' flag to rustdoc, when only two options would ever be
used (proc-macro vs anything else).
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Feb 25, 2023
…=estebank

[breaking change] Remove a rustdoc back compat warning

This warning was introduced in rust-lang#62855 for users who use `rustdoc` directly on proc macro crates (instead of using `cargo doc`) without passing `--crate-type proc-macro` (which `cargo doc` passed automatically).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, 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
9 participants