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