67aad6c180
This moves the `string_lit_as_bytes` tests into a new file and enables rustfix tests for them.
20 lines
441 B
Rust
20 lines
441 B
Rust
// run-rustfix
|
|
|
|
#![allow(dead_code, unused_variables)]
|
|
#![warn(clippy::string_lit_as_bytes)]
|
|
|
|
fn str_lit_as_bytes() {
|
|
let bs = b"hello there";
|
|
|
|
let bs = br###"raw string with three ### in it and some " ""###;
|
|
|
|
// no warning, because this cannot be written as a byte string literal:
|
|
let ubs = "☃".as_bytes();
|
|
|
|
let strify = stringify!(foobar).as_bytes();
|
|
|
|
let includestr = include_bytes!("entry.rs");
|
|
}
|
|
|
|
fn main() {}
|