about summary refs log tree commit diff
path: root/tests/ui/const-generics/generic_const_exprs/error_in_ty.stderr
blob: d822fa5894a5b624d9b4d14c8e6205e86d4f3d10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
error[E0425]: cannot find value `x` in this scope
  --> $DIR/error_in_ty.rs:6:31
   |
LL | pub struct A<const z: [usize; x]> {}
   |                    -          ^ help: a const parameter with a similar name exists: `z`
   |                    |
   |                    similarly named const parameter `z` defined here

error: `[usize; x]` is forbidden as the type of a const generic parameter
  --> $DIR/error_in_ty.rs:6:23
   |
LL | pub struct A<const z: [usize; x]> {}
   |                       ^^^^^^^^^^
   |
   = note: the only supported types are integers, `bool`, and `char`
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
   |
LL + #![feature(adt_const_params)]
   |

error[E0308]: mismatched types
  --> $DIR/error_in_ty.rs:10:8
   |
LL | impl A<2> {
   |        ^ expected `[usize; x]`, found integer

error[E0308]: mismatched types
  --> $DIR/error_in_ty.rs:16:8
   |
LL | impl A<2> {
   |        ^ expected `[usize; x]`, found integer

error[E0592]: duplicate definitions with name `B`
  --> $DIR/error_in_ty.rs:12:5
   |
LL |     pub const fn B() {}
   |     ^^^^^^^^^^^^^^^^ duplicate definitions for `B`
...
LL |     pub const fn B() {}
   |     ---------------- other definition for `B`

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0308, E0425, E0592.
For more information about an error, try `rustc --explain E0308`.