feature gate trait aliases

This commit is contained in:
Alex Burka 2017-12-03 12:55:22 -05:00
parent 4029a01984
commit 4f0b4f267f
4 changed files with 36 additions and 24 deletions

View file

@ -8,12 +8,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// gate-test-trait_alias
trait Alias1<T> = Default where T: Clone; // ok
//~^ERROR trait aliases are not yet implemented
//~^ERROR trait aliases are not yet fully implemented
trait Alias2<T: Clone = ()> = Default;
//~^ERROR type parameters on the left side of a trait alias cannot be bounded
//~^^ERROR type parameters on the left side of a trait alias cannot have defaults
//~^^^ERROR trait aliases are not yet implemented
//~^^^ERROR trait aliases are not yet fully implemented
impl Alias1 { //~ERROR expected type, found trait alias
fn foo() {}

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(trait_alias)]
trait SimpleAlias = Default; //~ERROR E0645
trait GenericAlias<T> = Iterator<Item=T>; //~ERROR E0645
trait Partial<T> = IntoIterator<Item=T>; //~ERROR E0645

View file

@ -1,37 +1,37 @@
error[E0645]: trait aliases are not yet implemented (see issue #41517)
--> $DIR/trait-alias.rs:11:1
|
11 | trait SimpleAlias = Default; //~ERROR E0645
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0645]: trait aliases are not yet implemented (see issue #41517)
--> $DIR/trait-alias.rs:12:1
|
12 | trait GenericAlias<T> = Iterator<Item=T>; //~ERROR E0645
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0645]: trait aliases are not yet implemented (see issue #41517)
--> $DIR/trait-alias.rs:13:1
|
13 | trait Partial<T> = IntoIterator<Item=T>; //~ERROR E0645
13 | trait SimpleAlias = Default; //~ERROR E0645
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0645]: trait aliases are not yet implemented (see issue #41517)
--> $DIR/trait-alias.rs:14:1
|
14 | trait GenericAlias<T> = Iterator<Item=T>; //~ERROR E0645
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0645]: trait aliases are not yet implemented (see issue #41517)
--> $DIR/trait-alias.rs:15:1
|
15 | trait Partial<T> = IntoIterator<Item=T>; //~ERROR E0645
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0645]: trait aliases are not yet implemented (see issue #41517)
--> $DIR/trait-alias.rs:22:1
--> $DIR/trait-alias.rs:24:1
|
22 | trait WithWhere<Art, Thou> = Romeo + Romeo where Fore<(Art, Thou)>: Romeo; //~ERROR E0645
24 | trait WithWhere<Art, Thou> = Romeo + Romeo where Fore<(Art, Thou)>: Romeo; //~ERROR E0645
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0645]: trait aliases are not yet implemented (see issue #41517)
--> $DIR/trait-alias.rs:23:1
|
23 | trait BareWhere<Wild, Are> = where The<Wild>: Things<Are>; //~ERROR E0645
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0645]: trait aliases are not yet implemented (see issue #41517)
--> $DIR/trait-alias.rs:25:1
|
25 | trait CD = Clone + Default; //~ERROR E0645
25 | trait BareWhere<Wild, Are> = where The<Wild>: Things<Are>; //~ERROR E0645
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0645]: trait aliases are not yet implemented (see issue #41517)
--> $DIR/trait-alias.rs:27:1
|
27 | trait CD = Clone + Default; //~ERROR E0645
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 6 previous errors