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