summaryrefslogtreecommitdiffstats
path: root/tests/ui/lexer/lex-bad-char-literals-6.rs
blob: 1b498c0fbca67cc05cb75d31072d0296c3cbfd3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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 {}
    if y == z {}  // no error here
    if x == z {}

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