rust-analyzer/crates/hir-expand/src
bors 16c8deeb86 Auto merge of #16835 - wyatt-herkamp:use_one_tt_for_a_derive, r=Veykril
Have Derive Attribute share a token tree with it's proc macros.

The goal of this PR is to stop creating a token tree for each derive proc macro.

This is done by giving the derive proc macros an id to its parent derive element.

From running the analysis stat on the rust analyzer project I did see a small memory decrease.

```
Inference:           42.80s, 362ginstr, 591mb
MIR lowering:        8.67s, 67ginstr, 291mb
Mir failed bodies: 18 (0%)
Data layouts:        85.81ms, 609minstr, 8mb
Failed data layouts: 135 (6%)
Const evaluation:    440.57ms, 5235minstr, 13mb
Failed const evals: 1 (0%)
Total:               64.16s, 552ginstr, 1731mb
```
After Change
```
Inference:           40.32s, 340ginstr, 593mb
MIR lowering:        7.95s, 62ginstr, 292mb
Mir failed bodies: 18 (0%)
Data layouts:        87.97ms, 591minstr, 8mb
Failed data layouts: 135 (6%)
Const evaluation:    433.38ms, 5226minstr, 14mb
Failed const evals: 1 (0%)
Total:               60.49s, 523ginstr, 1680mb
```

Currently this breaks the expansion for the actual derive attribute.

## TODO
- [x] Pick a better name for the function `smart_macro_arg`
2024-03-21 18:04:38 +00:00
..
attrs.rs Make use of ThinArc in RawAttrs 2024-03-21 11:49:09 +01:00
builtin_attr_macro.rs Repalce Span with SyntaxContextId in MacroCallLoc 2024-03-15 12:47:05 +01:00
builtin_derive_macro.rs Repalce Span with SyntaxContextId in MacroCallLoc 2024-03-15 12:47:05 +01:00
builtin_fn_macro.rs Move Edition into span crate 2024-03-21 10:21:44 +01:00
cfg_process.rs Remove MacroCallKind::DeriveAttr 2024-03-21 12:50:58 -04:00
change.rs Stop using an Arc when setting the file text 2024-03-08 20:30:12 +02:00
db.rs Review Updates 2024-03-21 13:41:46 -04:00
declarative.rs Resolve whether $pat is $pat_param or not via 🌟hygiene🌟 2024-03-21 10:22:45 +01:00
eager.rs Repalce Span with SyntaxContextId in MacroCallLoc 2024-03-15 12:47:05 +01:00
files.rs internal: Improve rooted upmapping 2024-03-12 13:46:58 +01:00
fixup.rs Remove usages of SpanData where Span suffices 2024-03-15 13:02:40 +01:00
hygiene.rs Repalce Span with SyntaxContextId in MacroCallLoc 2024-03-15 12:47:05 +01:00
lib.rs Remove MacroCallKind::DeriveAttr 2024-03-21 12:50:58 -04:00
mod_path.rs fix: Don't force draw a dependency edge to the real_span_map query 2024-03-07 14:14:59 +01:00
name.rs fix: Don't invalid body query results when generating desugared names 2024-03-07 15:03:16 +01:00
proc_macro.rs fix: Fix build scripts not being rebuilt in some occasions 2024-02-14 15:20:45 +01:00
quote.rs Remove dead test code 2024-03-14 16:24:51 +01:00
span_map.rs internal: Use assoc items as anchors for spans 2024-03-15 09:28:39 +01:00