Commit graph

14 commits

Author SHA1 Message Date
Chayim Refael Friedman
9d3368f2c2 Properly account for editions in names
This PR touches a lot of parts. But the main changes are changing
`hir_expand::Name` to be raw edition-dependently and only when necessary
(unrelated to how the user originally wrote the identifier),
and changing `is_keyword()` and `is_raw_identifier()` to be edition-aware
(this was done in #17896, but the FIXMEs were fixed here).

It is possible that I missed some cases, but most IDE parts should properly
escape (or not escape) identifiers now.

The rules of thumb are:

 - If we show the identifier to the user, its rawness should be determined
   by the edition of the edited crate. This is nice for IDE features,
   but really important for changes we insert to the source code.
 - For tests, I chose `Edition::CURRENT` (so we only have to (maybe) update
   tests when an edition becomes stable, to avoid churn).
 - For debugging tools (helper methods and logs), I used `Edition::LATEST`.
2024-08-16 16:46:24 +03:00
Lukas Wirth
df5f1777b8 More symbol usage 2024-07-16 12:05:16 +02:00
Lukas Wirth
60fa981df1 Simplify 2024-06-03 19:06:58 +02:00
Lukas Wirth
3a722bdf2e feat:Record FnAbi 2024-01-19 15:15:23 +01:00
Lukas Wirth
d80d2fcae0 Eagerly lower enum variants in CrateDefMap construction 2024-01-15 10:24:14 +01:00
Lukas Wirth
e243a03da1 Desugar builtin#format_args 2023-09-06 15:21:41 +02:00
hkalbasi
3a1054fc1c Replace x with it 2023-07-06 17:33:17 +03:30
Lukas Wirth
c7ef6c25b7 internal: Replace Display impl for Name 2023-05-24 20:55:12 +02:00
hkalbasi
cbcafd3539 MIR episode 5 2023-05-12 18:17:15 +03:30
Lukas Wirth
853ae1927d Slim down GenericArgs by one usize 2023-02-14 17:40:24 +01:00
Lukas Wirth
68723043db Split out hir-def attribute handling parts into hir-expand 2023-01-09 19:29:28 +01:00
Yuri Astrakhan
e16c76e3c3 Inline all format arguments where possible
This makes code more readale and concise,
moving all format arguments like `format!("{}", foo)`
into the more compact `format!("{foo}")` form.

The change was automatically created with, so there are far less change
of an accidental typo.

```
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2022-12-24 14:36:10 -05:00
Lukas Wirth
6f09c72b1b Lower unsafety of fn pointer and fn item types 2022-11-04 21:07:15 +01:00
Jonas Schievink
dcbe892d7c Add an HIR pretty-printer 2022-08-15 13:51:45 +02:00