]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/string_lit_as_bytes.stderr
Merge commit '1fcc74cc9e03bc91eaa80ecf92976b0b14b3aeb6' into clippyup
[rust.git] / src / tools / clippy / 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 3# plus " ""###.as_bytes();
13    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using a byte string literal instead: `br###"raw string with 3# plus " ""###`
14
15 error: calling `as_bytes()` on `include_str!(..)`
16   --> $DIR/string_lit_as_bytes.rs:19:22
17    |
18 LL |     let includestr = include_str!("entry_unfixable.rs").as_bytes();
19    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `include_bytes!(..)` instead: `include_bytes!("entry_unfixable.rs")`
20
21 error: calling `as_bytes()` on a string literal
22   --> $DIR/string_lit_as_bytes.rs:21:13
23    |
24 LL |     let _ = "string with newline/t/n".as_bytes();
25    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using a byte string literal instead: `b"string with newline/t/n"`
26
27 error: aborting due to 4 previous errors
28