diff options
| author | varkor <github@varkor.com> | 2019-05-03 14:42:38 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-05-04 14:39:43 +0100 |
| commit | 47f373128a9727f299b3ae53cbf7d26da74abc75 (patch) | |
| tree | 6a2c5b9337fff5b1e499fbf18c0bbde00cd4e3d0 | |
| parent | 823293bf1654ad1a841f7cfd67338d9b9d4d0667 (diff) | |
| download | rust-47f373128a9727f299b3ae53cbf7d26da74abc75.tar.gz rust-47f373128a9727f299b3ae53cbf7d26da74abc75.zip | |
Add tests
4 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/const-param-in-trait-ungated.rs b/src/test/ui/const-generics/const-param-in-trait-ungated.rs new file mode 100644 index 00000000000..8a81bcc1a80 --- /dev/null +++ b/src/test/ui/const-generics/const-param-in-trait-ungated.rs @@ -0,0 +1,3 @@ +trait Trait<const T: ()> {} //~ ERROR const generics are unstable + +fn main() {} diff --git a/src/test/ui/const-generics/const-param-in-trait-ungated.stderr b/src/test/ui/const-generics/const-param-in-trait-ungated.stderr new file mode 100644 index 00000000000..53bc9738414 --- /dev/null +++ b/src/test/ui/const-generics/const-param-in-trait-ungated.stderr @@ -0,0 +1,12 @@ +error[E0658]: const generics are unstable + --> $DIR/const-param-in-trait-ungated.rs:1:19 + | +LL | trait Trait<const T: ()> {} + | ^ + | + = note: for more information, see https://github.com/rust-lang/rust/issues/44580 + = help: add #![feature(const_generics)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/const-generics/const-param-in-trait.rs b/src/test/ui/const-generics/const-param-in-trait.rs new file mode 100644 index 00000000000..6e4f65fe6ca --- /dev/null +++ b/src/test/ui/const-generics/const-param-in-trait.rs @@ -0,0 +1,8 @@ +// run-pass + +#![feature(const_generics)] +//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash + +trait Trait<const T: ()> {} + +fn main() {} diff --git a/src/test/ui/const-generics/const-param-in-trait.stderr b/src/test/ui/const-generics/const-param-in-trait.stderr new file mode 100644 index 00000000000..a48eefddaa8 --- /dev/null +++ b/src/test/ui/const-generics/const-param-in-trait.stderr @@ -0,0 +1,6 @@ +warning: the feature `const_generics` is incomplete and may cause the compiler to crash + --> $DIR/const-param-in-trait.rs:3:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + |
