diff options
| author | Alexander Regueiro <alexreg@me.com> | 2019-02-12 01:50:33 +0000 |
|---|---|---|
| committer | Alexander Regueiro <alexreg@me.com> | 2019-02-12 01:50:33 +0000 |
| commit | aafbf742c2d93686e1a1b24c7c9ce3f0f9cc8921 (patch) | |
| tree | ba358e2391b6694457e64034a2e35ed66ce60651 /src/libsyntax/parse | |
| parent | 57d7cfc3cf50f0c427ad3043ff09eaef20671320 (diff) | |
| download | rust-aafbf742c2d93686e1a1b24c7c9ce3f0f9cc8921.tar.gz rust-aafbf742c2d93686e1a1b24c7c9ce3f0f9cc8921.zip | |
Disallow `auto` trait alias syntax.
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 69d6407d506..8e22ac7ae02 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -6534,8 +6534,14 @@ impl<'a> Parser<'a> { let bounds = self.parse_generic_bounds()?; tps.where_clause = self.parse_where_clause()?; self.expect(&token::Semi)?; + if is_auto == IsAuto::Yes { + let msg = "trait aliases cannot be `auto`"; + self.struct_span_err(self.prev_span, msg) + .span_label(self.prev_span, msg) + .emit(); + } if unsafety != Unsafety::Normal { - let msg = "trait aliases cannot be unsafe"; + let msg = "trait aliases cannot be `unsafe`"; self.struct_span_err(self.prev_span, msg) .span_label(self.prev_span, msg) .emit(); |
