]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/lex-bad-char-literals-6.rs
Merge commit '40dd3e2b7089b5e96714e064b731f6dbf17c61a9' into sync_cg_clif-2021-05-27
[rust.git] / src / test / ui / parser / lex-bad-char-literals-6.rs
1 fn main() {
2     let x: &str = 'ab';
3     //~^ ERROR: character literal may only contain one codepoint
4     let y: char = 'cd';
5     //~^ ERROR: character literal may only contain one codepoint
6     let z = 'ef';
7     //~^ ERROR: character literal may only contain one codepoint
8
9     if x == y {}
10     //~^ ERROR: can't compare `&str` with `char`
11     if y == z {}  // no error here
12     if x == z {}
13     //~^ ERROR: can't compare `&str` with `char`
14
15     let a: usize = "";
16     //~^ ERROR: mismatched types
17 }