about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorAlexander Regueiro <alexreg@me.com>2019-02-12 01:50:33 +0000
committerAlexander Regueiro <alexreg@me.com>2019-02-12 01:50:33 +0000
commitaafbf742c2d93686e1a1b24c7c9ce3f0f9cc8921 (patch)
treeba358e2391b6694457e64034a2e35ed66ce60651 /src/libsyntax/parse
parent57d7cfc3cf50f0c427ad3043ff09eaef20671320 (diff)
downloadrust-aafbf742c2d93686e1a1b24c7c9ce3f0f9cc8921.tar.gz
rust-aafbf742c2d93686e1a1b24c7c9ce3f0f9cc8921.zip
Disallow `auto` trait alias syntax.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs8
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();