diff options
| author | varkor <github@varkor.com> | 2019-05-11 00:08:40 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-05-11 00:08:40 +0100 |
| commit | b3207d531d01c1dc6c1f3d4e7b1c20a1546fe108 (patch) | |
| tree | 665b1d007093a7b3fe15ddb3677f2288ff8a7f9a /src/test/ui/const-generics/impl-const-generic-struct.rs | |
| parent | 0686daab4ec82a4127d317c01324d46c58ef47b3 (diff) | |
| download | rust-b3207d531d01c1dc6c1f3d4e7b1c20a1546fe108.tar.gz rust-b3207d531d01c1dc6c1f3d4e7b1c20a1546fe108.zip | |
Add test for const impl
Diffstat (limited to 'src/test/ui/const-generics/impl-const-generic-struct.rs')
| -rw-r--r-- | src/test/ui/const-generics/impl-const-generic-struct.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/impl-const-generic-struct.rs b/src/test/ui/const-generics/impl-const-generic-struct.rs new file mode 100644 index 00000000000..7a0c0f2be5d --- /dev/null +++ b/src/test/ui/const-generics/impl-const-generic-struct.rs @@ -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); +} |
