Skip to content

Commit aafbf74

Browse files
author
Alexander Regueiro
committed
Disallow auto trait alias syntax.
1 parent 57d7cfc commit aafbf74

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6534,8 +6534,14 @@ impl<'a> Parser<'a> {
65346534
let bounds = self.parse_generic_bounds()?;
65356535
tps.where_clause = self.parse_where_clause()?;
65366536
self.expect(&token::Semi)?;
6537+
if is_auto == IsAuto::Yes {
6538+
let msg = "trait aliases cannot be `auto`";
6539+
self.struct_span_err(self.prev_span, msg)
6540+
.span_label(self.prev_span, msg)
6541+
.emit();
6542+
}
65376543
if unsafety != Unsafety::Normal {
6538-
let msg = "trait aliases cannot be unsafe";
6544+
let msg = "trait aliases cannot be `unsafe`";
65396545
self.struct_span_err(self.prev_span, msg)
65406546
.span_label(self.prev_span, msg)
65416547
.emit();

0 commit comments

Comments
 (0)