]> git.lizzy.rs Git - rust.git/blob - tests/ui/inference/char-as-str-single.rs
Rollup merge of #106869 - notriddle:notriddle/item-decl-pre-rust, r=GuillaumeGomez
[rust.git] / tests / ui / inference / char-as-str-single.rs
1 // When a SINGLE-character string literal is used where a char should be,
2 // suggest changing to single quotes.
3
4 // Testing both single-byte and multi-byte characters, as we should handle both.
5
6 // run-rustfix
7
8 fn main() {
9     let _: char = "a"; //~ ERROR mismatched types
10     let _: char = "人"; //~ ERROR mismatched types
11     let _: char = "'"; //~ ERROR mismatched types
12 }