1 error[E0308]: mismatched types
2 --> $DIR/str-lit-type-mismatch.rs:2:20
4 LL | let x: &[u8] = "foo";
5 | ----- ^^^^^ expected slice `[u8]`, found `str`
9 = note: expected reference `&[u8]`
10 found reference `&'static str`
11 help: consider adding a leading `b`
13 LL | let x: &[u8] = b"foo";
16 error[E0308]: mismatched types
17 --> $DIR/str-lit-type-mismatch.rs:3:23
19 LL | let y: &[u8; 4] = "baaa";
20 | -------- ^^^^^^ expected array `[u8; 4]`, found `str`
22 | expected due to this
24 = note: expected reference `&[u8; 4]`
25 found reference `&'static str`
26 help: consider adding a leading `b`
28 LL | let y: &[u8; 4] = b"baaa";
31 error[E0308]: mismatched types
32 --> $DIR/str-lit-type-mismatch.rs:4:19
34 LL | let z: &str = b"foo";
35 | ---- ^^^^^^ expected `str`, found array `[u8; 3]`
37 | expected due to this
39 = note: expected reference `&str`
40 found reference `&'static [u8; 3]`
41 help: consider removing the leading `b`
43 LL - let z: &str = b"foo";
44 LL + let z: &str = "foo";
47 error: aborting due to 3 previous errors
49 For more information about this error, try `rustc --explain E0308`.