rust/tests/ui/lexer/lex-bad-char-literals-6.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
402 B
Rust
Raw Normal View History

2019-01-19 13:37:58 -06:00
fn main() {
2019-01-19 23:53:28 -06:00
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
2019-01-19 13:37:58 -06:00
2019-01-19 23:53:28 -06:00
if x == y {}
2019-01-19 13:37:58 -06:00
if y == z {} // no error here
2019-01-19 23:53:28 -06:00
if x == z {}
2019-01-19 13:37:58 -06:00
2019-01-19 23:53:28 -06:00
let a: usize = "";
//~^ ERROR: mismatched types
}