]> git.proxmox.com Git - rustc.git/blame - src/test/ui/str/str-lit-type-mismatch.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / str / str-lit-type-mismatch.stderr
CommitLineData
ea8adc8c 1error[E0308]: mismatched types
0731742a 2 --> $DIR/str-lit-type-mismatch.rs:2:20
ea8adc8c 3 |
532ac7d7 4LL | 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
11help: consider adding a leading `b`
12 |
13LL | let x: &[u8] = b"foo";
14 | +
ea8adc8c
XL
15
16error[E0308]: mismatched types
0731742a 17 --> $DIR/str-lit-type-mismatch.rs:3:23
ea8adc8c 18 |
532ac7d7 19LL | 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
26help: consider adding a leading `b`
27 |
28LL | let y: &[u8; 4] = b"baaa";
29 | +
ea8adc8c
XL
30
31error[E0308]: mismatched types
0731742a 32 --> $DIR/str-lit-type-mismatch.rs:4:19
ea8adc8c 33 |
532ac7d7 34LL | 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
41help: consider removing the leading `b`
42 |
43LL - let z: &str = b"foo";
44LL + let z: &str = "foo";
923072b8 45 |
ea8adc8c
XL
46
47error: aborting due to 3 previous errors
48
0531ce1d 49For more information about this error, try `rustc --explain E0308`.