blob: 6354d5376ad685fb65370e590b4e4157350d266e [file] [log] [blame]
#![warn(clippy::string_from_utf8_as_bytes)]
macro_rules! test_range {
($start:expr, $end:expr) => {
$start..$end
};
}
fn main() {
let _ = std::str::from_utf8(&"Hello World!".as_bytes()[6..11]);
//~^ string_from_utf8_as_bytes
let s = "Hello World!";
let _ = std::str::from_utf8(&s.as_bytes()[test_range!(6, 11)]);
//~^ string_from_utf8_as_bytes
}