]> git.proxmox.com Git - rustc.git/blob - src/test/ui/parser/lex-bad-char-literals-6.rs
New upstream version 1.34.2+dfsg1
[rustc.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 }