Skip to content

Commit b3207d5

Browse files
committed
Add test for const impl
1 parent 0686daa commit b3207d5

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
struct S<const X: u32>;
7+
8+
impl<const X: u32> S<{X}> {
9+
fn x() -> u32 {
10+
X
11+
}
12+
}
13+
14+
fn main() {
15+
assert_eq!(S::<19>::x(), 19);
16+
}
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/impl-const-generic-struct.rs:3:12
3+
|
4+
LL | #![feature(const_generics)]
5+
| ^^^^^^^^^^^^^^
6+

0 commit comments

Comments
 (0)