]> git.lizzy.rs Git - rust.git/blob - src/test/ui/repeat_count.stderr
unboxed-closures and type-alias-impl-trait nll revisions
[rust.git] / src / test / ui / repeat_count.stderr
1 error[E0435]: attempt to use a non-constant value in a constant
2   --> $DIR/repeat_count.rs:5:17
3    |
4 LL |     let n = 1;
5    |     ----- help: consider using `const` instead of `let`: `const n`
6 LL |     let a = [0; n];
7    |                 ^ non-constant value
8
9 error[E0308]: mismatched types
10   --> $DIR/repeat_count.rs:7:17
11    |
12 LL |     let b = [0; ()];
13    |                 ^^ expected `usize`, found `()`
14
15 error[E0308]: mismatched types
16   --> $DIR/repeat_count.rs:10:17
17    |
18 LL |     let c = [0; true];
19    |                 ^^^^ expected `usize`, found `bool`
20
21 error[E0308]: mismatched types
22   --> $DIR/repeat_count.rs:13:17
23    |
24 LL |     let d = [0; 0.5];
25    |                 ^^^ expected `usize`, found floating-point number
26
27 error[E0308]: mismatched types
28   --> $DIR/repeat_count.rs:16:17
29    |
30 LL |     let e = [0; "foo"];
31    |                 ^^^^^ expected `usize`, found `&str`
32
33 error[E0308]: mismatched types
34   --> $DIR/repeat_count.rs:19:17
35    |
36 LL |     let f = [0; -4_isize];
37    |                 ^^^^^^^^ expected `usize`, found `isize`
38    |
39    = note: `-4_isize` cannot fit into type `usize`
40
41 error[E0308]: mismatched types
42   --> $DIR/repeat_count.rs:22:23
43    |
44 LL |     let f = [0_usize; -1_isize];
45    |                       ^^^^^^^^ expected `usize`, found `isize`
46    |
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`
56    |
57 LL |     let f = [0; 4usize];
58    |                  ~~~~~
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`
65
66 error: aborting due to 9 previous errors
67
68 Some errors have detailed explanations: E0308, E0435.
69 For more information about an error, try `rustc --explain E0308`.