rust/tests/ui/inference/str-as-char.fixed
2023-01-11 09:32:08 +00:00

11 lines
349 B
Rust

// When a char literal is used where a str should be,
// suggest changing to double quotes.
// run-rustfix
fn main() {
let _: &str = "a"; //~ ERROR mismatched types
let _: &str = "\"\"\""; //~ ERROR character literal may only contain one codepoint
let _: &str = "\"\"\""; //~ ERROR character literal may only contain one codepoint
}