]> git.lizzy.rs Git - rust.git/blob - tests/ui/string_lit_as_bytes.stderr
Auto merge of #3879 - phansch:rustfix_string_lit_as_bytes, r=flip1995
[rust.git] / tests / ui / string_lit_as_bytes.stderr
1 error: calling `as_bytes()` on a string literal
2   --> $DIR/string_lit_as_bytes.rs:7:14
3    |
4 LL |     let bs = "hello there".as_bytes();
5    |              ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using a byte string literal instead: `b"hello there"`
6    |
7    = note: `-D clippy::string-lit-as-bytes` implied by `-D warnings`
8
9 error: calling `as_bytes()` on a string literal
10   --> $DIR/string_lit_as_bytes.rs:9:14
11    |
12 LL |     let bs = r###"raw string with three ### in it and some " ""###.as_bytes();
13    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using a byte string literal instead: `br###"raw string with three ### in it and some " ""###`
14
15 error: calling `as_bytes()` on `include_str!(..)`
16   --> $DIR/string_lit_as_bytes.rs:16:22
17    |
18 LL |     let includestr = include_str!("entry.rs").as_bytes();
19    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `include_bytes!(..)` instead: `include_bytes!("entry.rs")`
20
21 error: aborting due to 3 previous errors
22