rust/compiler/rustc_expand/src
Matthias Krüger 150b9d753b
Rollup merge of #107488 - nnethercote:fix-PartialEq-syntax, r=RalfJung
Fix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.

If you do `derive(PartialEq)` on a packed struct, the output shown by `-Zunpretty=expanded` includes expressions like this:
```
{ self.x } == { other.x }
```
This is invalid syntax. This doesn't break compilation, because the AST nodes are constructed within the compiler. But it does mean anyone using `-Zunpretty=expanded` output as a guide for hand-written impls could get a nasty surprise.

This commit fixes things by instead using this form:
```
({ self.x }) == ({ other.x })
```

r? ``@RalfJung``
2023-02-02 06:52:14 +01:00
..
mbe Replace some _ == _ || _ == _s with matches!(_, _ | _)s 2023-01-30 12:26:26 +00:00
mut_visit rustc_ast: Turn MutVisitor::token_visiting_enabled into a constant 2021-10-18 00:23:24 +03:00
parse rustc_expand: remove ref patterns 2023-01-17 07:48:19 +00:00
tokenstream Remove TokenStreamBuilder. 2022-10-05 12:42:54 +11:00
base.rs session: diagnostic migration lint on more fns 2023-01-30 17:11:35 +00:00
build.rs Fix syntax in -Zunpretty-expanded output for derived PartialEq. 2023-02-01 15:14:05 +11:00
config.rs rustc_expand: remove ref patterns 2023-01-17 07:48:19 +00:00
errors.rs session: diagnostic migration lint on more fns 2023-01-30 17:11:35 +00:00
expand.rs rustc_expand: remove ref patterns 2023-01-17 07:48:19 +00:00
lib.rs Migrate parts of rustc_expand to session diagnostics 2022-12-10 11:02:41 +01:00
mbe.rs Move macro_rules diagnostics to diagnostics module 2022-11-20 13:06:44 +01:00
module.rs Migrate parts of rustc_expand to session diagnostics 2022-12-10 11:02:41 +01:00
placeholders.rs Split MacArgs in two. 2022-11-22 09:04:15 +11:00
proc_macro.rs Add the #[derive_const] attribute 2022-09-20 11:57:58 +00:00
proc_macro_server.rs Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstrieb 2023-01-20 04:52:28 +00:00
tests.rs Migrate parts of rustc_expand to session diagnostics 2022-12-10 11:02:41 +01:00