rust/compiler/rustc_metadata
Yuki Okushi eb5e63e3f0
Rollup merge of #107171 - petrochenkov:encattrs, r=cjgillot
rustc_metadata: Fix `encode_attrs`

This function didn't do what the authors intended it to do.

- Due to `move` in the closure `is_public` wasn't captured by mutalbe reference and wasn't used as a cache.
- Due to iterator cloning all the `should_encode_attr` logic run for the second time to calculate `may_have_doc_links`

This PR fixes these issues, and calculates all the needed attribute flags in one go.

(Noticed while implementing https://github.com/rust-lang/rust/pull/107136.)
2023-01-27 12:57:54 +09:00
..
src Rollup merge of #107171 - petrochenkov:encattrs, r=cjgillot 2023-01-27 12:57:54 +09:00
Cargo.toml rustc_metadata: Encode doc(hidden) flag to metadata 2023-01-21 22:35:20 +04:00