rust/compiler/rustc_middle/src
bors dff1edf919 Auto merge of #79519 - cjgillot:noattr, r=wesleywiser
Store HIR attributes in a side table

Same idea as #72015 but for attributes.
The objective is to reduce incr-comp invalidations due to modified attributes.
Notably, those due to modified doc comments.

Implementation:
- collect attributes during AST->HIR lowering, in `LocalDefId -> ItemLocalId -> &[Attributes]` nested tables;
- access the attributes through a `hir_owner_attrs` query;
- local refactorings to use this access;
- remove `attrs` from HIR data structures one-by-one.

Change in behaviour:
- the HIR visitor traverses all attributes at once instead of parent-by-parent;
- attribute arrays are sometimes duplicated: for statements and variant constructors;
- as a consequence, attributes are marked as used after unused-attribute lint emission to avoid duplicate lints.

~~Current bug: the lint level is not correctly applied in `std::backtrace_rs`, triggering an unused attribute warning on `#![no_std]`. I welcome suggestions.~~
2021-03-10 08:40:51 +00:00
..
dep_graph Access the session directly from DepContext. 2021-02-20 22:53:46 +01:00
hir Use BTreeMap to store attributes. 2021-03-09 19:28:01 +01:00
ich Remove hir::Expr::attrs. 2021-03-09 19:27:58 +01:00
infer Move a few more types to rustc_type_ir 2021-01-18 21:06:12 +01:00
middle Enforce that query results implement Debug 2021-01-16 17:53:02 -05:00
mir Rollup merge of #79208 - LeSeulArtichaut:stable-unsafe_op_in_unsafe_fn, r=nikomatsakis 2021-03-10 08:01:25 +09:00
query Use BTreeMap to store attributes. 2021-03-09 19:28:01 +01:00
traits Change x64 size checks to not apply to x32. 2021-03-06 16:02:48 +00:00
ty Change x64 size checks to not apply to x32. 2021-03-06 16:02:48 +00:00
util Make panic/assert calls in rustc compatible with Rust 2021. 2021-02-03 22:42:53 +01:00
arena.rs Combination of commits 2020-12-03 09:50:10 -08:00
lib.rs Split DepKindStruct in two. 2021-02-19 17:51:56 +01:00
lint.rs Rollup merge of #81713 - estebank:unstable-assoc-item-lint, r=oli-obk 2021-02-25 14:33:53 +01:00
macros.rs Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obk 2020-11-17 12:24:34 +00:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00