]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #84442 - jyn514:doc-cfg, r=petrochenkov
authorDylan DPC <dylan.dpc@gmail.com>
Fri, 7 May 2021 14:19:19 +0000 (16:19 +0200)
committerGitHub <noreply@github.com>
Fri, 7 May 2021 14:19:19 +0000 (16:19 +0200)
commit0c8c21d224ca94f63d2b07000e8223f3a041281b
tree47cb068c6bff685ccb7caba44516655f9b3a5ce5
parentcd37b950584cb320dc7a9a7bb59e8da5f91eb3c8
parent6eb4735acc50f58e501b42c5d75ae73b3d74b44d
Rollup merge of #84442 - jyn514:doc-cfg, r=petrochenkov

Unify rustc and rustdoc parsing of `cfg()`

This extracts a new `parse_cfg` function that's used between both.

- Treat `#[doc(cfg(x), cfg(y))]` the same as `#[doc(cfg(x)]
  #[doc(cfg(y))]`. Previously it would be completely ignored.
- Treat `#[doc(inline, cfg(x))]` the same as `#[doc(inline)]
  #[doc(cfg(x))]`. Previously, the cfg would be ignored.
- Pass the cfg predicate through to rustc_expand to be validated

Technically this is a breaking change, but doc_cfg is still nightly so I don't think it matters.

Fixes https://github.com/rust-lang/rust/issues/84437.

r? `````````@petrochenkov`````````
src/librustdoc/clean/inline.rs
src/librustdoc/clean/mod.rs
src/librustdoc/clean/types.rs
src/librustdoc/doctest.rs
src/librustdoc/html/render/context.rs
src/librustdoc/html/render/print_item.rs