]>
Commit | Line | Data |
---|---|---|
ea8adc8c | 1 | error[E0308]: mismatched types |
0731742a | 2 | --> $DIR/str-lit-type-mismatch.rs:2:20 |
ea8adc8c | 3 | | |
532ac7d7 | 4 | LL | let x: &[u8] = "foo"; |
94222f64 XL |
5 | | ----- ^^^^^ expected slice `[u8]`, found `str` |
6 | | | | |
60c5eb7d | 7 | | expected due to this |
ea8adc8c | 8 | | |
60c5eb7d XL |
9 | = note: expected reference `&[u8]` |
10 | found reference `&'static str` | |
94222f64 XL |
11 | help: consider adding a leading `b` |
12 | | | |
13 | LL | let x: &[u8] = b"foo"; | |
14 | | + | |
ea8adc8c XL |
15 | |
16 | error[E0308]: mismatched types | |
0731742a | 17 | --> $DIR/str-lit-type-mismatch.rs:3:23 |
ea8adc8c | 18 | | |
532ac7d7 | 19 | LL | let y: &[u8; 4] = "baaa"; |
94222f64 XL |
20 | | -------- ^^^^^^ expected array `[u8; 4]`, found `str` |
21 | | | | |
60c5eb7d | 22 | | expected due to this |
ea8adc8c | 23 | | |
60c5eb7d XL |
24 | = note: expected reference `&[u8; 4]` |
25 | found reference `&'static str` | |
94222f64 XL |
26 | help: consider adding a leading `b` |
27 | | | |
28 | LL | let y: &[u8; 4] = b"baaa"; | |
29 | | + | |
ea8adc8c XL |
30 | |
31 | error[E0308]: mismatched types | |
0731742a | 32 | --> $DIR/str-lit-type-mismatch.rs:4:19 |
ea8adc8c | 33 | | |
532ac7d7 | 34 | LL | let z: &str = b"foo"; |
94222f64 XL |
35 | | ---- ^^^^^^ expected `str`, found array `[u8; 3]` |
36 | | | | |
60c5eb7d | 37 | | expected due to this |
ea8adc8c | 38 | | |
60c5eb7d XL |
39 | = note: expected reference `&str` |
40 | found reference `&'static [u8; 3]` | |
94222f64 XL |
41 | help: consider removing the leading `b` |
42 | | | |
43 | LL - let z: &str = b"foo"; | |
44 | LL + let z: &str = "foo"; | |
923072b8 | 45 | | |
ea8adc8c XL |
46 | |
47 | error: aborting due to 3 previous errors | |
48 | ||
0531ce1d | 49 | For more information about this error, try `rustc --explain E0308`. |