|
| 1 | +error: character literal may only contain one codepoint |
| 2 | + --> $DIR/lex-bad-char-literals-6.rs:2:19 |
| 3 | + | |
| 4 | +LL | let x: &str = 'ab'; //~ ERROR: character literal may only contain one codepoint |
| 5 | + | ^^^^ |
| 6 | + |
| 7 | +error: character literal may only contain one codepoint |
| 8 | + --> $DIR/lex-bad-char-literals-6.rs:3:19 |
| 9 | + | |
| 10 | +LL | let y: char = 'cd'; //~ ERROR: character literal may only contain one codepoint |
| 11 | + | ^^^^ |
| 12 | + |
| 13 | +error: character literal may only contain one codepoint |
| 14 | + --> $DIR/lex-bad-char-literals-6.rs:4:13 |
| 15 | + | |
| 16 | +LL | let z = 'ef'; //~ ERROR: character literal may only contain one codepoint |
| 17 | + | ^^^^ |
| 18 | + |
| 19 | +error[E0308]: mismatched types |
| 20 | + --> $DIR/lex-bad-char-literals-6.rs:2:19 |
| 21 | + | |
| 22 | +LL | let x: &str = 'ab'; //~ ERROR: character literal may only contain one codepoint |
| 23 | + | ^^^^ expected &str, found char |
| 24 | + | |
| 25 | + = note: expected type `&str` |
| 26 | + found type `char` |
| 27 | + |
| 28 | +error[E0277]: can't compare `&str` with `char` |
| 29 | + --> $DIR/lex-bad-char-literals-6.rs:6:10 |
| 30 | + | |
| 31 | +LL | if x == y {} // no error here |
| 32 | + | ^^ no implementation for `&str == char` |
| 33 | + | |
| 34 | + = help: the trait `std::cmp::PartialEq<char>` is not implemented for `&str` |
| 35 | + |
| 36 | +error[E0308]: mismatched types |
| 37 | + --> $DIR/lex-bad-char-literals-6.rs:10:20 |
| 38 | + | |
| 39 | +LL | let a: usize = ""; // type error here to confirm we got past the parser |
| 40 | + | ^^ expected usize, found reference |
| 41 | + | |
| 42 | + = note: expected type `usize` |
| 43 | + found type `&'static str` |
| 44 | + |
| 45 | +error[E0277]: can't compare `&str` with `char` |
| 46 | + --> $DIR/lex-bad-char-literals-6.rs:8:10 |
| 47 | + | |
| 48 | +LL | if x == z {} // no error here |
| 49 | + | ^^ no implementation for `&str == char` |
| 50 | + | |
| 51 | + = help: the trait `std::cmp::PartialEq<char>` is not implemented for `&str` |
| 52 | + |
| 53 | +error: aborting due to 7 previous errors |
| 54 | + |
| 55 | +Some errors occurred: E0277, E0308. |
| 56 | +For more information about an error, try `rustc --explain E0277`. |
0 commit comments