Skip to content

Commit 47f3731

Browse files
committed
Add tests
1 parent 823293b commit 47f3731

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trait Trait<const T: ()> {} //~ ERROR const generics are unstable
2+
3+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0658]: const generics are unstable
2+
--> $DIR/const-param-in-trait-ungated.rs:1:19
3+
|
4+
LL | trait Trait<const T: ()> {}
5+
| ^
6+
|
7+
= note: for more information, see https://github.com/rust-lang/rust/issues/44580
8+
= help: add #![feature(const_generics)] to the crate attributes to enable
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0658`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// run-pass
2+
3+
#![feature(const_generics)]
4+
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
5+
6+
trait Trait<const T: ()> {}
7+
8+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
2+
--> $DIR/const-param-in-trait.rs:3:12
3+
|
4+
LL | #![feature(const_generics)]
5+
| ^^^^^^^^^^^^^^
6+

0 commit comments

Comments
 (0)