]>
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 | 3 | | |
5869c6ff XL |
4 | LL | let n = 1; |
5 | | ----- help: consider using `const` instead of `let`: `const n` | |
b7449926 XL |
6 | LL | let a = [0; n]; |
7 | | ^ non-constant value | |
8 | ||
9 | error[E0308]: mismatched types | |
0731742a | 10 | --> $DIR/repeat_count.rs:7:17 |
b7449926 XL |
11 | | |
12 | LL | let b = [0; ()]; | |
60c5eb7d | 13 | | ^^ expected `usize`, found `()` |
b7449926 XL |
14 | |
15 | error[E0308]: mismatched types | |
60c5eb7d | 16 | --> $DIR/repeat_count.rs:10:17 |
b7449926 XL |
17 | | |
18 | LL | let c = [0; true]; | |
60c5eb7d | 19 | | ^^^^ expected `usize`, found `bool` |
b7449926 XL |
20 | |
21 | error[E0308]: mismatched types | |
60c5eb7d | 22 | --> $DIR/repeat_count.rs:13:17 |
b7449926 XL |
23 | | |
24 | LL | let d = [0; 0.5]; | |
60c5eb7d | 25 | | ^^^ expected `usize`, found floating-point number |
b7449926 XL |
26 | |
27 | error[E0308]: mismatched types | |
60c5eb7d | 28 | --> $DIR/repeat_count.rs:16:17 |
b7449926 XL |
29 | | |
30 | LL | let e = [0; "foo"]; | |
60c5eb7d | 31 | | ^^^^^ expected `usize`, found `&str` |
b7449926 XL |
32 | |
33 | error[E0308]: mismatched types | |
60c5eb7d | 34 | --> $DIR/repeat_count.rs:19:17 |
b7449926 XL |
35 | | |
36 | LL | let f = [0; -4_isize]; | |
60c5eb7d | 37 | | ^^^^^^^^ expected `usize`, found `isize` |
e74abb32 | 38 | | |
f035d41b | 39 | = note: `-4_isize` cannot fit into type `usize` |
b7449926 XL |
40 | |
41 | error[E0308]: mismatched types | |
60c5eb7d | 42 | --> $DIR/repeat_count.rs:22:23 |
b7449926 XL |
43 | | |
44 | LL | let f = [0_usize; -1_isize]; | |
60c5eb7d | 45 | | ^^^^^^^^ expected `usize`, found `isize` |
e74abb32 | 46 | | |
f035d41b XL |
47 | = note: `-1_isize` cannot fit into type `usize` |
48 | ||
49 | error[E0308]: mismatched types | |
50 | --> $DIR/repeat_count.rs:25:17 | |
51 | | | |
52 | LL | let f = [0; 4u8]; | |
53 | | ^^^ expected `usize`, found `u8` | |
54 | | | |
55 | help: change the type of the numeric literal from `u8` to `usize` | |
48663c56 | 56 | | |
f035d41b | 57 | LL | let f = [0; 4usize]; |
c295e0f8 | 58 | | ~~~~~ |
94222f64 XL |
59 | |
60 | error[E0308]: mismatched types | |
61 | --> $DIR/repeat_count.rs:31:17 | |
62 | | | |
63 | LL | let g = [0; G { g: () }]; | |
64 | | ^^^^^^^^^^^ expected `usize`, found struct `G` | |
b7449926 | 65 | |
f035d41b | 66 | error: aborting due to 9 previous errors |
b7449926 | 67 | |
48663c56 | 68 | Some errors have detailed explanations: E0308, E0435. |
b7449926 | 69 | For more information about an error, try `rustc --explain E0308`. |