summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lexer/lex-bad-char-literals-6.rs
blob: 4379b4fa6d777b53006a85a3360e2b9a1b6c52b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn main() {
    let x: &str = 'ab';
    //~^ ERROR: character literal may only contain one codepoint
    let y: char = 'cd';
    //~^ ERROR: character literal may only contain one codepoint
    let z = 'ef';
    //~^ ERROR: character literal may only contain one codepoint

    if x == y {}
    //~^ ERROR: can't compare `&str` with `char`
    if y == z {}  // no error here
    if x == z {}
    //~^ ERROR: can't compare `&str` with `char`

    let a: usize = "";
    //~^ ERROR: mismatched types
}