]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/const-generics/array-size-in-generic-struct-param.rs
Make `TooGeneric` error in WF checking a proper error
[rust.git] / src / test / ui / const-generics / array-size-in-generic-struct-param.rs
index f3be7b56db589ab2e3c114d7e46e3113bf9a72d3..d996bf56fcc10c443cc524cbe24d8598b672cec8 100644 (file)
@@ -1,10 +1,9 @@
-// run-pass
-
 #![feature(const_generics)]
 //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
 
 #[allow(dead_code)]
-struct ArithArrayLen<const N: usize>([u32; 0 + N]); // ok
+struct ArithArrayLen<const N: usize>([u32; 0 + N]);
+//~^ ERROR constant expression depends on a generic parameter
 
 #[derive(PartialEq, Eq)]
 struct Config {
@@ -12,7 +11,7 @@ struct Config {
 }
 
 struct B<const CFG: Config> {
-    arr: [u8; CFG.arr_size], // ok
+    arr: [u8; CFG.arr_size], //~ ERROR constant expression depends on a generic parameter
 }
 
 const C: Config = Config { arr_size: 5 };