Commit Graph

9 Commits

Author SHA1 Message Date
Aaron Hill 1498608135
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.
2019-08-24 13:11:57 -04:00
Vadim Petrochenkov 48635226d8 Remove `MacroKind::ProcMacroStub`
It's internal to resolve and always results in `Res::Err` outside of resolve.
Instead put `DefKind::Fn`s themselves into the macro namespace, it's ok.

Proc macro stubs are items placed into macro namespase for functions that define proc macros.
https://github.com/rust-lang/rust/pull/52383

The rustdoc test is changed because the old test didn't actually reproduce the ICE it was supposed to reproduce.
2019-07-11 00:12:07 +03:00
QuietMisdreavus b876694734 add intra-doc link test to proc-macro test 2019-01-22 15:44:19 -06:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Oliver Middleton 0bb075f5a5 rustdoc: Fix local reexports of proc macros
Filter out `ProcMacroStub`s to avoid an ICE during cleaning.

Also add proc macros to `cache().paths` so it can generate links.
2018-12-08 18:33:09 +00:00
Eduard-Mihai Burtescu 3369929ddb tests: use `force-host` and `no-prefer-dynamic` in all proc_macro tests. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu d3ab4a74ef tests: remove ignore-stage1 where possible in proc_macro tests. 2018-11-30 06:15:20 +02:00
QuietMisdreavus d37f3696b1 check for proc-macros in "all items" 2018-09-27 10:22:29 -05:00
QuietMisdreavus aea1bd0a59 handle proc-macros as macros instead of functions 2018-09-25 14:56:43 -05:00