1 error[E0308]: mismatched types
2 --> $DIR/str-lit-type-mismatch.rs:13:20
4 LL | let x: &[u8] = "foo"; //~ ERROR mismatched types
7 | expected slice, found str
8 | help: consider adding a leading `b`: `b"foo"`
10 = note: expected type `&[u8]`
11 found type `&'static str`
13 error[E0308]: mismatched types
14 --> $DIR/str-lit-type-mismatch.rs:14:23
16 LL | let y: &[u8; 4] = "baaa"; //~ ERROR mismatched types
19 | expected array of 4 elements, found str
20 | help: consider adding a leading `b`: `b"baaa"`
22 = note: expected type `&[u8; 4]`
23 found type `&'static str`
25 error[E0308]: mismatched types
26 --> $DIR/str-lit-type-mismatch.rs:15:19
28 LL | let z: &str = b"foo"; //~ ERROR mismatched types
31 | expected str, found array of 3 elements
32 | help: consider removing the leading `b`: `"foo"`
34 = note: expected type `&str`
35 found type `&'static [u8; 3]`
37 error: aborting due to 3 previous errors
39 For more information about this error, try `rustc --explain E0308`.