diff options
| author | bors <bors@rust-lang.org> | 2018-08-25 22:50:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-08-25 22:50:12 +0000 |
| commit | f272688bbb1e007126384e8a0474ec1ea64dc481 (patch) | |
| tree | 0336c6ffc3684e6ab57ffbe4fae15e57ea382976 /src/libsyntax/parse | |
| parent | 39e6ba82182b264c94bc62a1284d115b50ff1bd3 (diff) | |
| parent | b32b6e803b8e7ad1ee2258ef5784af7e4010be4b (diff) | |
| download | rust-f272688bbb1e007126384e8a0474ec1ea64dc481.tar.gz rust-f272688bbb1e007126384e8a0474ec1ea64dc481.zip | |
Auto merge of #53612 - mark-i-m:anon_param_disallowed_2018, r=petrochenkov
Remove anonymous trait params from 2018 and beyond cc @Centril @nikomatsakis cc #41686 rust-lang/rfcs#2522 #53272 This PR removes support for anonymous trait parameters syntactically in rust 2018 and onward. TODO: - [x] Add tests
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 725360b842d..1695d3a8f96 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1376,7 +1376,13 @@ impl<'a> Parser<'a> { // This is somewhat dubious; We don't want to allow // argument names to be left off if there is a // definition... - p.parse_arg_general(false) + + // We don't allow argument names to be left off in edition 2018. + if p.span.edition() >= Edition::Edition2018 { + p.parse_arg_general(true) + } else { + p.parse_arg_general(false) + } })?; generics.where_clause = self.parse_where_clause()?; |
