Skip to content

Commit

Permalink
Added tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Regueiro committed Feb 12, 2019
1 parent aafbf74 commit 370f1f2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/ui/traits/trait-alias-syntax.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#![feature(trait_alias)]

trait Foo {}
auto trait A = Foo; //~ ERROR trait aliases cannot be `auto`
unsafe trait B = Foo; //~ ERROR trait aliases cannot be `unsafe`

fn main() {}
14 changes: 14 additions & 0 deletions src/test/ui/traits/trait-alias-syntax.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: trait aliases cannot be `auto`
--> $DIR/trait-alias-syntax.rs:4:19
|
LL | auto trait A = Foo; //~ ERROR trait aliases cannot be `auto`
| ^ trait aliases cannot be `auto`

error: trait aliases cannot be `unsafe`
--> $DIR/trait-alias-syntax.rs:5:21
|
LL | unsafe trait B = Foo; //~ ERROR trait aliases cannot be `unsafe`
| ^ trait aliases cannot be `unsafe`

error: aborting due to 2 previous errors

0 comments on commit 370f1f2

Please sign in to comment.