rust/tests/ui/str/str-lit-type-mismatch.rs

6 lines
177 B
Rust

fn main() {
let x: &[u8] = "foo"; //~ ERROR mismatched types
let y: &[u8; 4] = "baaa"; //~ ERROR mismatched types
let z: &str = b"foo"; //~ ERROR mismatched types
}