about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/coverage/graph.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-03-10 08:40:51 +0000
committerbors <bors@rust-lang.org>2021-03-10 08:40:51 +0000
commitdff1edf919198aa4dea106e63b7d1899f1061fe0 (patch)
treee89b1e39488265fccd99dc2161d0dc60187a1445 /compiler/rustc_mir/src/transform/coverage/graph.rs
parent861872bc453bde79b83ff99d443d035225f10e87 (diff)
parent77c0f217ff2197aa0bbafc3cdb01b3da9016e514 (diff)
downloadrust-dff1edf919198aa4dea106e63b7d1899f1061fe0.tar.gz
rust-dff1edf919198aa4dea106e63b7d1899f1061fe0.zip
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.~~
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/graph.rs')
0 files changed, 0 insertions, 0 deletions