]> git.lizzy.rs Git - rust.git/commit
Improve Rustdoc's handling of procedural macros
authorAaron Hill <aa1ronham@gmail.com>
Sat, 20 Jul 2019 20:34:41 +0000 (16:34 -0400)
committerAaron Hill <aa1ronham@gmail.com>
Sat, 24 Aug 2019 17:11:57 +0000 (13:11 -0400)
commit14986081355db0a2ae67df6a43dd9e6e360d718c
treeb7e00f9fc66819182fb8d881bc6ee640620b87a4
parent478464570e60523adc6d303577d1782229ca1f93
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](https://github.com/rust-lang/cargo/pull/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.
13 files changed:
src/librustc/session/config.rs
src/librustc_interface/passes.rs
src/librustdoc/clean/inline.rs
src/librustdoc/config.rs
src/librustdoc/core.rs
src/librustdoc/lib.rs
src/librustdoc/test.rs
src/test/rustdoc-ui/failed-doctest-output.rs
src/test/rustdoc-ui/failed-doctest-output.stdout
src/test/rustdoc/inline_cross/auxiliary/proc_macro.rs
src/test/rustdoc/inline_cross/proc_macro.rs
src/test/rustdoc/proc-macro.rs
src/test/rustdoc/rustc-macro-crate.rs