about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-20 23:50:27 +0100
committerGitHub <noreply@github.com>2022-11-20 23:50:27 +0100
commitfce077b05362bee14d01335e52bd6b6b9cf88682 (patch)
tree4860b5a6bf1cfc2215197ef21559b8632f21b88d /compiler/rustc_codegen_llvm/src
parent7a10c4aea216ea8d5eaf51f5deebd13d5a743230 (diff)
parentbb0cb9ae9fb2dbebc62627a3f1f4326771338535 (diff)
downloadrust-fce077b05362bee14d01335e52bd6b6b9cf88682.tar.gz
rust-fce077b05362bee14d01335e52bd6b6b9cf88682.zip
Rollup merge of #104504 - compiler-errors:fru-syntax-note, r=estebank
Add a detailed note for missing comma typo w/ FRU syntax

Thanks to `@pierwill` for working on this with me!

Fixes #104373, perhaps `@alice-i-cecile` can comment on the new error for the example provided on that issue -- feedback is welcome.

```
error[E0063]: missing field `defaulted` in initializer of `Outer`
  --> $DIR/multi-line-fru-suggestion.rs:14:5
   |
LL |     Outer {
   |     ^^^^^ missing `defaulted`
   |
note: this expression may have been misinterpreted as a `..` range expression
  --> $DIR/multi-line-fru-suggestion.rs:16:16
   |
LL |           inner: Inner {
   |  ________________^
LL | |             a: 1,
LL | |             b: 2,
LL | |         }
   | |_________^ this expression does not end in a comma...
LL |           ..Default::default()
   |           ^^^^^^^^^^^^^^^^^^^^ ... so this is interpreted as a `..` range expression, instead of functional record update syntax
help: to set the remaining fields from `Default::default()`, separate the last named field with a comma
   |
LL |         },
   |          +

error: aborting due to previous error

For more information about this error, try `rustc --explain E0063`.
```
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions