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