rust/src/test/ui/parser/lex-bad-char-literals-6.stderr

60 lines
1.7 KiB
Plaintext
Raw Normal View History

2019-01-19 13:37:58 -06:00
error: character literal may only contain one codepoint
--> $DIR/lex-bad-char-literals-6.rs:2:19
|
2019-01-19 23:53:28 -06:00
LL | let x: &str = 'ab';
2019-01-19 13:37:58 -06:00
| ^^^^
|
help: if you meant to write a `str` literal, use double quotes
|
LL | let x: &str = "ab";
| ^^^^
2019-01-19 13:37:58 -06:00
error: character literal may only contain one codepoint
2019-01-19 23:53:28 -06:00
--> $DIR/lex-bad-char-literals-6.rs:4:19
2019-01-19 13:37:58 -06:00
|
2019-01-19 23:53:28 -06:00
LL | let y: char = 'cd';
2019-01-19 13:37:58 -06:00
| ^^^^
|
help: if you meant to write a `str` literal, use double quotes
|
LL | let y: char = "cd";
| ^^^^
2019-01-19 13:37:58 -06:00
error: character literal may only contain one codepoint
2019-01-19 23:53:28 -06:00
--> $DIR/lex-bad-char-literals-6.rs:6:13
2019-01-19 13:37:58 -06:00
|
2019-01-19 23:53:28 -06:00
LL | let z = 'ef';
2019-01-19 13:37:58 -06:00
| ^^^^
|
help: if you meant to write a `str` literal, use double quotes
|
LL | let z = "ef";
| ^^^^
2019-01-19 13:37:58 -06:00
error[E0277]: can't compare `&str` with `char`
2019-01-19 23:53:28 -06:00
--> $DIR/lex-bad-char-literals-6.rs:9:10
2019-01-19 13:37:58 -06:00
|
2019-01-19 23:53:28 -06:00
LL | if x == y {}
2019-01-19 13:37:58 -06:00
| ^^ no implementation for `&str == char`
|
= help: the trait `std::cmp::PartialEq<char>` is not implemented for `&str`
error[E0308]: mismatched types
2019-01-19 23:53:28 -06:00
--> $DIR/lex-bad-char-literals-6.rs:15:20
2019-01-19 13:37:58 -06:00
|
2019-01-19 23:53:28 -06:00
LL | let a: usize = "";
| ^^ expected `usize`, found `&str`
2019-01-19 13:37:58 -06:00
error[E0277]: can't compare `&str` with `char`
2019-01-19 23:53:28 -06:00
--> $DIR/lex-bad-char-literals-6.rs:12:10
2019-01-19 13:37:58 -06:00
|
2019-01-19 23:53:28 -06:00
LL | if x == z {}
2019-01-19 13:37:58 -06:00
| ^^ no implementation for `&str == char`
|
= help: the trait `std::cmp::PartialEq<char>` is not implemented for `&str`
2019-01-19 23:53:28 -06:00
error: aborting due to 6 previous errors
2019-01-19 13:37:58 -06:00
Some errors have detailed explanations: E0277, E0308.
2019-01-19 13:37:58 -06:00
For more information about an error, try `rustc --explain E0277`.