summaryrefslogtreecommitdiffstats
path: root/src/test/ui/inference/str-as-char.rs
blob: eaa8d788c34674ea2ad88003c097a7d3552c024a (plain)
1
2
3
4
5
6
7
8
9
10
// 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
}