rust/src/libsyntax
kennytm e6a6d980e0 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.
2017-10-13 23:37:57 +08:00
..
2017-08-30 01:38:54 +03:00
2017-09-22 22:05:18 +02:00
2017-05-24 16:40:03 -04:00
2017-09-20 20:48:06 +02:00
2017-08-30 01:38:54 +03:00
2017-09-22 22:05:18 +02:00
2016-11-21 09:00:56 +00:00
2017-09-01 12:46:37 -05:00
2017-08-30 01:38:54 +03:00
2017-06-07 12:15:39 +09:00
2017-08-30 01:38:54 +03:00
2017-08-30 01:38:54 +03:00
2017-08-30 01:38:54 +03:00
2017-08-30 01:38:54 +03:00
2017-07-28 15:46:26 +02:00

NB: This crate is part of the Rust compiler. For an overview of the compiler as a whole, see the README.md file found in librustc.

The syntax crate contains those things concerned purely with syntax that is, the AST ("abstract syntax tree"), parser, pretty-printer, lexer, macro expander, and utilities for traversing ASTs.