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
..
diagnostics Make fields of Span private 2017-08-30 01:38:54 +03:00
ext Rename FileMap::path and change to an Option 2017-10-03 19:47:33 +10:00
parse Rollup merge of #45178 - Badel2:comma-after-struct, r=petrochenkov 2017-10-13 23:37:57 +08:00
print Add information about the syntax used in ranges 2017-09-22 22:05:18 +02:00
util Add support for ..= syntax 2017-09-22 22:05:18 +02:00
abi.rs add thiscall calling convention support 2017-05-24 16:40:03 -04:00
ast.rs Auto merge of #44943 - nivkner:fixme_fixup, r=dtolnay 2017-10-05 19:52:00 +00:00
attr.rs Fix ICE 2017-09-20 20:48:06 +02:00
build.rs rustc: Add some build scripts for librustc crates 2017-07-22 22:04:13 -07:00
Cargo.toml Remove rustc_bitflags; use the bitflags crate 2017-09-17 14:19:24 -04:00
codemap.rs Rename FileMap::path and change to an Option 2017-10-03 19:47:33 +10:00
config.rs Make fields of Span private 2017-08-30 01:38:54 +03:00
diagnostic_list.rs Add support for ..= syntax 2017-09-22 22:05:18 +02:00
entry.rs Cleanup InternedString. 2016-11-21 09:00:56 +00:00
feature_gate.rs implement pattern-binding-modes RFC 2017-10-06 16:30:23 -04:00
fold.rs Implement RFC 1925 2017-09-01 12:46:37 -05:00
json.rs Make fields of Span private 2017-08-30 01:38:54 +03:00
lib.rs Remove rustc_bitflags; use the bitflags crate 2017-09-17 14:19:24 -04:00
ptr.rs Replace some matches with try. 2017-06-07 12:15:39 +09:00
README.md rework the README.md for rustc and add other readmes 2017-09-19 09:00:59 -04:00
show_span.rs use field init shorthand EVERYWHERE 2017-08-15 15:29:17 -07:00
std_inject.rs Make fields of Span private 2017-08-30 01:38:54 +03:00
str.rs syntax: Copy unstable str::char_at into libsyntax 2015-04-21 10:23:53 -07:00
test.rs Make fields of Span private 2017-08-30 01:38:54 +03:00
test_snippet.rs Make fields of Span private 2017-08-30 01:38:54 +03:00
tokenstream.rs Make fields of Span private 2017-08-30 01:38:54 +03:00
visit.rs Remove support for gen arg 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.