about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/coverage/json.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-02-24 00:31:01 +0000
committerbors <bors@rust-lang.org>2020-02-24 00:31:01 +0000
commit79cd224e758f603898b64308e849fbb9be6e6f4d (patch)
tree6baaaa0f7f57a4b5b20013878c06e9087b4ee58c /src/test/rustdoc-ui/coverage/json.rs
parent6d0e58bff88f620c1a4f641a627f046bf4cde4ad (diff)
parent1c75f5aaa177734c8dbdab91612a8d59b519bf07 (diff)
downloadrust-79cd224e758f603898b64308e849fbb9be6e6f4d.tar.gz
rust-79cd224e758f603898b64308e849fbb9be6e6f4d.zip
Auto merge of #69366 - Centril:unified-items, r=petrochenkov
parse: unify item parsing & filter illegal item kinds

This PR fully unifies item parsing into a single `fn parse_item_common` method which produces `Option<Item>`. The `Item` is then mapped into `ForeignItem` and `AssocItem` as necessary by transforming the `*Kind` and converting contextually bad variants into `None`, thereby filtering them away.

The PR does not yet unmerge the definition of `ForeignItemKind` from `AssocItemKind`. I've left that as future work as it didn't feel like this parser-focused PR would be the best one to deal with it. Changes to the AST data structures are instead kept to a reasonable minimum.

Based on https://github.com/rust-lang/rust/pull/69361.

Fixes https://github.com/rust-lang/rust/issues/48137.
RELNOTES: Now, `item` macro fragments can be interpolated into `impl`, `trait`, and `extern` contexts. See `src/test/ui/parser/issue-48137-macros-cannot-interpolate-impl-items.rs` for the relevant test.

r? @petrochenkov
cc @estebank
Diffstat (limited to 'src/test/rustdoc-ui/coverage/json.rs')
0 files changed, 0 insertions, 0 deletions