Commit graph

16 commits

Author SHA1 Message Date
Chayim Refael Friedman
ceba289f80 Store token trees in contiguous Vec instead of as a tree
I expected this to be faster (due to less allocations and better cache locality), but benchmarked it is not (neither it is slower). Memory usage, however, drops by ~50mb (of `analysis-stats .`). I guess tt construction is just not hot.

This also simplifies using even less memory for token trees by compressing equal span, which I plan to do right after.

Some workflows are more easily expressed with a flat tt, while some are better expressed with a tree. With the right helpers, though (which was mostly a matter of trial and error), even the worst workflows become very easy indeed.
2025-01-02 19:21:46 +02:00
Lukas Wirth
6c23f25e7f Fix new nightly lints 2024-10-22 11:48:41 +02:00
Lukas Wirth
ae9c553902 Make basic use of spans for macro expansion errors 2024-07-29 14:52:40 +02:00
GnomedDev
8011b56827
Swap Subtree::token_trees from Vec to boxed slice 2024-02-04 00:28:22 +00:00
Ryo Yoshida
4e793e7859
Use anonymous lifetime where possible 2023-06-29 23:27:28 +09:00
Lukas Wirth
e59487de38 Add tests for float access macro call inputs 2023-02-07 17:12:24 +01:00
Lukas Wirth
9053bcc65c Make mbe compile with parser changes 2023-02-03 21:39:24 +01:00
Lukas Wirth
41a46a78f2 Make tt generic over the span data 2023-01-31 14:58:16 +01:00
Yuri Astrakhan
e341e996f7 Clippy-fix explicit auto-deref
Seems like these can be safely fixed. With one, I was particularly
surprised -- `Some(pats) => &**pats,` in body.rs?

```
cargo clippy --fix -- -A clippy::all -D clippy::explicit_auto_deref
```
2022-12-23 02:52:14 -05:00
Amos Wenger
816f7fe12a Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
Aramis Razzaghipour
9583dd5725
Replace if let with match where appropriate 2021-10-05 09:00:21 +11:00
Aramis Razzaghipour
eff195852d
Fix miscellaneous Clippy lints 2021-10-03 23:53:30 +11:00
Jade
20b325c7d5 tree-wide: make rustdoc links spiky so they are clickable 2021-06-13 21:58:05 -07:00
Aleksey Kladov
188b0f96f9 Add more docs 2021-05-22 16:53:47 +03:00
Edwin Cheng
af3d75ad2e Refactor TokenBuffer for reduc cloning 2021-01-05 02:00:46 +08:00
Aleksey Kladov
550d7fbe3c Rename ra_tt -> tt 2020-08-12 16:46:54 +02:00
Renamed from crates/ra_tt/src/buffer.rs (Browse further)