Skip to content

Commit

Permalink
Add test for const impl
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed May 10, 2019
1 parent 0686daa commit b3207d5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/ui/const-generics/impl-const-generic-struct.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// run-pass

#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash

struct S<const X: u32>;

impl<const X: u32> S<{X}> {
fn x() -> u32 {
X
}
}

fn main() {
assert_eq!(S::<19>::x(), 19);
}
6 changes: 6 additions & 0 deletions src/test/ui/const-generics/impl-const-generic-struct.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
--> $DIR/impl-const-generic-struct.rs:3:12
|
LL | #![feature(const_generics)]
| ^^^^^^^^^^^^^^

0 comments on commit b3207d5

Please sign in to comment.