]> git.proxmox.com Git - rustc.git/blame - src/test/ui/repeat_count.stderr
New upstream version 1.61.0+dfsg1
[rustc.git] / src / test / ui / 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
XL
32
33error[E0308]: mismatched types
60c5eb7d 34 --> $DIR/repeat_count.rs:19:17
b7449926
XL
35 |
36LL | 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
41error[E0308]: mismatched types
60c5eb7d 42 --> $DIR/repeat_count.rs:22:23
b7449926
XL
43 |
44LL | 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
49error[E0308]: mismatched types
50 --> $DIR/repeat_count.rs:25:17
51 |
52LL | let f = [0; 4u8];
53 | ^^^ expected `usize`, found `u8`
54 |
55help: change the type of the numeric literal from `u8` to `usize`
48663c56 56 |
f035d41b 57LL | let f = [0; 4usize];
c295e0f8 58 | ~~~~~
94222f64
XL
59
60error[E0308]: mismatched types
61 --> $DIR/repeat_count.rs:31:17
62 |
63LL | let g = [0; G { g: () }];
64 | ^^^^^^^^^^^ expected `usize`, found struct `G`
b7449926 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`.