]> git.lizzy.rs Git - rust.git/blob - src/test/ui/repeat_count.stderr
Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa
[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 a = [0; n];
5    |                 ^ non-constant value
6
7 error[E0308]: mismatched types
8   --> $DIR/repeat_count.rs:7:17
9    |
10 LL |     let b = [0; ()];
11    |                 ^^ expected `usize`, found `()`
12
13 error[E0308]: mismatched types
14   --> $DIR/repeat_count.rs:10:17
15    |
16 LL |     let c = [0; true];
17    |                 ^^^^ expected `usize`, found `bool`
18
19 error[E0308]: mismatched types
20   --> $DIR/repeat_count.rs:13:17
21    |
22 LL |     let d = [0; 0.5];
23    |                 ^^^ expected `usize`, found floating-point number
24
25 error[E0308]: mismatched types
26   --> $DIR/repeat_count.rs:16:17
27    |
28 LL |     let e = [0; "foo"];
29    |                 ^^^^^ expected `usize`, found `&str`
30
31 error[E0308]: mismatched types
32   --> $DIR/repeat_count.rs:31:17
33    |
34 LL |     let g = [0; G { g: () }];
35    |                 ^^^^^^^^^^^ expected `usize`, found struct `main::G`
36
37 error[E0308]: mismatched types
38   --> $DIR/repeat_count.rs:19:17
39    |
40 LL |     let f = [0; -4_isize];
41    |                 ^^^^^^^^ expected `usize`, found `isize`
42    |
43    = note: `-4_isize` cannot fit into type `usize`
44
45 error[E0308]: mismatched types
46   --> $DIR/repeat_count.rs:22:23
47    |
48 LL |     let f = [0_usize; -1_isize];
49    |                       ^^^^^^^^ expected `usize`, found `isize`
50    |
51    = note: `-1_isize` cannot fit into type `usize`
52
53 error[E0308]: mismatched types
54   --> $DIR/repeat_count.rs:25:17
55    |
56 LL |     let f = [0; 4u8];
57    |                 ^^^ expected `usize`, found `u8`
58    |
59 help: change the type of the numeric literal from `u8` to `usize`
60    |
61 LL |     let f = [0; 4usize];
62    |                 ^^^^^^
63
64 error: aborting due to 9 previous errors
65
66 Some errors have detailed explanations: E0308, E0435.
67 For more information about an error, try `rustc --explain E0308`.