]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | error[E0435]: attempt to use a non-constant value in a constant |
0731742a | 2 | --> $DIR/repeat_count.rs:5:17 |
b7449926 XL |
3 | | |
4 | LL | let a = [0; n]; | |
5 | | ^ non-constant value | |
6 | ||
7 | error[E0308]: mismatched types | |
0731742a | 8 | --> $DIR/repeat_count.rs:7:17 |
b7449926 XL |
9 | | |
10 | LL | let b = [0; ()]; | |
60c5eb7d | 11 | | ^^ expected `usize`, found `()` |
b7449926 XL |
12 | |
13 | error[E0308]: mismatched types | |
60c5eb7d | 14 | --> $DIR/repeat_count.rs:10:17 |
b7449926 XL |
15 | | |
16 | LL | let c = [0; true]; | |
60c5eb7d | 17 | | ^^^^ expected `usize`, found `bool` |
b7449926 XL |
18 | |
19 | error[E0308]: mismatched types | |
60c5eb7d | 20 | --> $DIR/repeat_count.rs:13:17 |
b7449926 XL |
21 | | |
22 | LL | let d = [0; 0.5]; | |
60c5eb7d | 23 | | ^^^ expected `usize`, found floating-point number |
b7449926 XL |
24 | |
25 | error[E0308]: mismatched types | |
60c5eb7d | 26 | --> $DIR/repeat_count.rs:16:17 |
b7449926 XL |
27 | | |
28 | LL | let e = [0; "foo"]; | |
60c5eb7d | 29 | | ^^^^^ expected `usize`, found `&str` |
b7449926 | 30 | |
ba9703b0 XL |
31 | error[E0308]: mismatched types |
32 | --> $DIR/repeat_count.rs:28:17 | |
33 | | | |
34 | LL | let g = [0; G { g: () }]; | |
35 | | ^^^^^^^^^^^ expected `usize`, found struct `main::G` | |
36 | ||
b7449926 | 37 | error[E0308]: mismatched types |
60c5eb7d | 38 | --> $DIR/repeat_count.rs:19:17 |
b7449926 XL |
39 | | |
40 | LL | let f = [0; -4_isize]; | |
60c5eb7d | 41 | | ^^^^^^^^ expected `usize`, found `isize` |
e74abb32 | 42 | | |
48663c56 XL |
43 | help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit |
44 | | | |
45 | LL | let f = [0; (-4_isize).try_into().unwrap()]; | |
46 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
b7449926 XL |
47 | |
48 | error[E0308]: mismatched types | |
60c5eb7d | 49 | --> $DIR/repeat_count.rs:22:23 |
b7449926 XL |
50 | | |
51 | LL | let f = [0_usize; -1_isize]; | |
60c5eb7d | 52 | | ^^^^^^^^ expected `usize`, found `isize` |
e74abb32 | 53 | | |
48663c56 XL |
54 | help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit |
55 | | | |
56 | LL | let f = [0_usize; (-1_isize).try_into().unwrap()]; | |
57 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
b7449926 | 58 | |
b7449926 XL |
59 | error: aborting due to 8 previous errors |
60 | ||
48663c56 | 61 | Some errors have detailed explanations: E0308, E0435. |
b7449926 | 62 | For more information about an error, try `rustc --explain E0308`. |