about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-01-30 16:29:52 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-02-01 15:14:05 +1100
commit75e87d1f81290052a07fe85e3809d48a46613fb1 (patch)
tree8633a95bf924cc7c67a4bbb0fda71d1d7526dab9 /compiler/rustc_query_impl/src
parenta322848c6b0e037c1f0209387558ecb6ab763714 (diff)
downloadrust-75e87d1f81290052a07fe85e3809d48a46613fb1.tar.gz
rust-75e87d1f81290052a07fe85e3809d48a46613fb1.zip
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 })
```
Diffstat (limited to 'compiler/rustc_query_impl/src')
0 files changed, 0 insertions, 0 deletions