rust/compiler/rustc_interface/src
bors c9cf9c6507 Auto merge of #92294 - Kobzol:rustdoc-meta-kind, r=GuillaumeGomez
Add Attribute::meta_kind

The `AttrItem::meta` function is being called on a lot of places, however almost always the caller is only interested in the `kind` of the result `MetaItem`. Before, the `path`  had to be cloned in order to get the kind, now it does not have to be.

There is a larger related "problem". In a lot of places, something wants to know contents of attributes. This is accessed through `Attribute::meta_item_list`, which calls `AttrItem::meta` (now `AttrItem::meta_kind`), among other methods. When this function is called, the meta item list has to be recreated from scratch. Everytime something asks a simple question (like is this item/list of attributes `#[doc(hidden)]`?), the tokens of the attribute(s) are cloned, parsed and the results are allocated on the heap. That seems really unnecessary. What would be the best way to cache this? Turn `meta_item_list` into a query perhaps? Related PR: https://github.com/rust-lang/rust/pull/92227

r? rust-lang/rustdoc
2022-01-01 02:03:23 +00:00
..
callbacks.rs Fix clippy lints 2021-10-01 23:17:19 +02:00
interface.rs Made temps-dir an unstable option. 2021-11-07 09:32:05 +01:00
lib.rs Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
passes.rs Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
proc_macro_decls.rs Avoid more invocations of hir_crate query. 2021-09-29 23:16:47 +02:00
queries.rs Use OutputFilenames to generate output file for -Zllvm-time-trace 2021-12-13 00:00:00 +00:00
tests.rs Auto merge of #88354 - Jmc18134:hint-space-pauth-opt, r=nagisa 2021-12-29 22:35:11 +00:00
util.rs Add Attribute::meta_kind 2021-12-26 16:56:34 +01:00