|
| 1 | +error[E0425]: cannot find value `x` in this scope |
| 2 | + --> $DIR/error_in_ty.rs:6:31 |
| 3 | + | |
| 4 | +LL | pub struct A<const z: [usize; x]> {} |
| 5 | + | - ^ help: a const parameter with a similar name exists: `z` |
| 6 | + | | |
| 7 | + | similarly named const parameter `z` defined here |
| 8 | + |
| 9 | +error: `[usize; x]` is forbidden as the type of a const generic parameter |
| 10 | + --> $DIR/error_in_ty.rs:6:23 |
| 11 | + | |
| 12 | +LL | pub struct A<const z: [usize; x]> {} |
| 13 | + | ^^^^^^^^^^ |
| 14 | + | |
| 15 | + = note: the only supported types are integers, `bool` and `char` |
| 16 | +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types |
| 17 | + | |
| 18 | +LL + #![feature(adt_const_params)] |
| 19 | + | |
| 20 | + |
| 21 | +error[E0308]: mismatched types |
| 22 | + --> $DIR/error_in_ty.rs:10:8 |
| 23 | + | |
| 24 | +LL | impl A<2> { |
| 25 | + | ^ expected `[usize; x]`, found integer |
| 26 | + |
| 27 | +error[E0308]: mismatched types |
| 28 | + --> $DIR/error_in_ty.rs:16:8 |
| 29 | + | |
| 30 | +LL | impl A<2> { |
| 31 | + | ^ expected `[usize; x]`, found integer |
| 32 | + |
| 33 | +error[E0592]: duplicate definitions with name `B` |
| 34 | + --> $DIR/error_in_ty.rs:12:5 |
| 35 | + | |
| 36 | +LL | pub const fn B() {} |
| 37 | + | ^^^^^^^^^^^^^^^^ duplicate definitions for `B` |
| 38 | +... |
| 39 | +LL | pub const fn B() {} |
| 40 | + | ---------------- other definition for `B` |
| 41 | + |
| 42 | +error: aborting due to 5 previous errors |
| 43 | + |
| 44 | +Some errors have detailed explanations: E0308, E0425, E0592. |
| 45 | +For more information about an error, try `rustc --explain E0308`. |
0 commit comments