diff options
| author | kennytm <kennytm@gmail.com> | 2017-10-13 23:37:57 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-13 23:37:57 +0800 |
| commit | e6a6d980e086d88d7b87163a16834ceb72a1f9de (patch) | |
| tree | ac1b0401e89e42fc36e13a41b75ddf196c38fbec /src/test/run-pass/thinlto | |
| parent | 46d86d38479546c0356103b1589b47a284767a26 (diff) | |
| parent | 72cfd209410da7f9dd09357a3361bb5b561dee33 (diff) | |
| download | rust-e6a6d980e086d88d7b87163a16834ceb72a1f9de.tar.gz rust-e6a6d980e086d88d7b87163a16834ceb72a1f9de.zip | |
Rollup merge of #45178 - Badel2:comma-after-struct, r=petrochenkov
Better error message for comma after base struct
#41834
This adds a better error for commas after the base struct:
```
let foo = Foo {
one: 111,
..Foo::default(), // This comma is a syntax error
};
```
The current error is a generic `expected one of ...` which isn't beginner-friendly. My error looks like this:
```
error: cannot use a comma after the base struct
--> tmp/example.rs:26:9
|
26 | ..Foo::default(),
| ^^^^^^^^^^^^^^^^- help: remove this comma
|
= note: the base struct expansion must always be the last field
```
I even added a note for people who don't know why this isn't allowed.
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions
