Commit dff1edf
committed
Auto merge of rust-lang#79519 - cjgillot:noattr, r=wesleywiser
Store HIR attributes in a side table
Same idea as rust-lang#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.~~File tree
88 files changed
+869
-853
lines changed- compiler
- rustc_ast_lowering/src
- rustc_codegen_ssa/src/back
- rustc_hir_pretty/src
- rustc_hir/src
- rustc_incremental/src
- persist
- rustc_index/src
- rustc_interface/src
- rustc_lint/src
- rustc_metadata/src
- rustc_middle/src
- hir
- map
- ich
- query
- rustc_mir_build/src
- rustc_passes/src
- rustc_plugin_impl/src
- rustc_privacy/src
- rustc_resolve/src/late
- rustc_save_analysis/src
- rustc_typeck/src
- check
- method
- src
- librustdoc
- clean
- test
- incremental/hashes
- ui-fulldeps/auxiliary
- ui
- feature-gates
- unused
- tools/clippy
- clippy_lints/src
- utils
- clippy_utils/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
88 files changed
+869
-853
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
262 | | - | |
263 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
264 | 273 | | |
265 | 274 | | |
266 | 275 | | |
| |||
272 | 281 | | |
273 | 282 | | |
274 | 283 | | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
281 | 287 | | |
282 | 288 | | |
283 | 289 | | |
| |||
618 | 624 | | |
619 | 625 | | |
620 | 626 | | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
629 | 630 | | |
630 | 631 | | |
631 | 632 | | |
| |||
669 | 670 | | |
670 | 671 | | |
671 | 672 | | |
672 | | - | |
| 673 | + | |
673 | 674 | | |
674 | 675 | | |
675 | 676 | | |
| |||
690 | 691 | | |
691 | 692 | | |
692 | 693 | | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
| 694 | + | |
| 695 | + | |
699 | 696 | | |
700 | 697 | | |
701 | 698 | | |
| |||
849 | 846 | | |
850 | 847 | | |
851 | 848 | | |
852 | | - | |
853 | 849 | | |
854 | 850 | | |
855 | 851 | | |
| |||
1026 | 1022 | | |
1027 | 1023 | | |
1028 | 1024 | | |
1029 | | - | |
| 1025 | + | |
1030 | 1026 | | |
1031 | 1027 | | |
1032 | 1028 | | |
| |||
1785 | 1781 | | |
1786 | 1782 | | |
1787 | 1783 | | |
1788 | | - | |
| 1784 | + | |
1789 | 1785 | | |
1790 | 1786 | | |
1791 | 1787 | | |
| |||
1795 | 1791 | | |
1796 | 1792 | | |
1797 | 1793 | | |
1798 | | - | |
| 1794 | + | |
1799 | 1795 | | |
1800 | 1796 | | |
1801 | 1797 | | |
| |||
1819 | 1815 | | |
1820 | 1816 | | |
1821 | 1817 | | |
1822 | | - | |
1823 | | - | |
1824 | | - | |
1825 | | - | |
1826 | | - | |
1827 | | - | |
| 1818 | + | |
| 1819 | + | |
1828 | 1820 | | |
1829 | 1821 | | |
1830 | 1822 | | |
| |||
2159 | 2151 | | |
2160 | 2152 | | |
2161 | 2153 | | |
2162 | | - | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
2163 | 2157 | | |
2164 | 2158 | | |
2165 | 2159 | | |
2166 | 2160 | | |
2167 | 2161 | | |
2168 | 2162 | | |
2169 | 2163 | | |
2170 | | - | |
2171 | | - | |
2172 | | - | |
2173 | | - | |
2174 | | - | |
2175 | | - | |
2176 | | - | |
2177 | | - | |
| 2164 | + | |
2178 | 2165 | | |
2179 | 2166 | | |
0 commit comments