about summary refs log tree commit diff
path: root/src/test/run-pass/thinlto
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2017-10-13 23:37:57 +0800
committerGitHub <noreply@github.com>2017-10-13 23:37:57 +0800
commite6a6d980e086d88d7b87163a16834ceb72a1f9de (patch)
treeac1b0401e89e42fc36e13a41b75ddf196c38fbec /src/test/run-pass/thinlto
parent46d86d38479546c0356103b1589b47a284767a26 (diff)
parent72cfd209410da7f9dd09357a3361bb5b561dee33 (diff)
downloadrust-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