summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lexer/lex-bad-char-literals-6.stderr
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/lexer/lex-bad-char-literals-6.stderr81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/test/ui/lexer/lex-bad-char-literals-6.stderr b/src/test/ui/lexer/lex-bad-char-literals-6.stderr
new file mode 100644
index 000000000..afef0cb60
--- /dev/null
+++ b/src/test/ui/lexer/lex-bad-char-literals-6.stderr
@@ -0,0 +1,81 @@
+error: character literal may only contain one codepoint
+ --> $DIR/lex-bad-char-literals-6.rs:2:19
+ |
+LL | let x: &str = 'ab';
+ | ^^^^
+ |
+help: if you meant to write a `str` literal, use double quotes
+ |
+LL | let x: &str = "ab";
+ | ~~~~
+
+error: character literal may only contain one codepoint
+ --> $DIR/lex-bad-char-literals-6.rs:4:19
+ |
+LL | let y: char = 'cd';
+ | ^^^^
+ |
+help: if you meant to write a `str` literal, use double quotes
+ |
+LL | let y: char = "cd";
+ | ~~~~
+
+error: character literal may only contain one codepoint
+ --> $DIR/lex-bad-char-literals-6.rs:6:13
+ |
+LL | let z = 'ef';
+ | ^^^^
+ |
+help: if you meant to write a `str` literal, use double quotes
+ |
+LL | let z = "ef";
+ | ~~~~
+
+error[E0277]: can't compare `&str` with `char`
+ --> $DIR/lex-bad-char-literals-6.rs:9:10
+ |
+LL | if x == y {}
+ | ^^ no implementation for `&str == char`
+ |
+ = help: the trait `PartialEq<char>` is not implemented for `&str`
+ = help: the following other types implement trait `PartialEq<Rhs>`:
+ <&'a str as PartialEq<OsString>>
+ <&'a str as PartialEq<String>>
+ <&'b str as PartialEq<Cow<'a, str>>>
+ <String as PartialEq<&'a str>>
+ <String as PartialEq<Cow<'a, str>>>
+ <String as PartialEq<str>>
+ <String as PartialEq>
+ <str as PartialEq<Cow<'a, str>>>
+ and 4 others
+
+error[E0308]: mismatched types
+ --> $DIR/lex-bad-char-literals-6.rs:15:20
+ |
+LL | let a: usize = "";
+ | ----- ^^ expected `usize`, found `&str`
+ | |
+ | expected due to this
+
+error[E0277]: can't compare `&str` with `char`
+ --> $DIR/lex-bad-char-literals-6.rs:12:10
+ |
+LL | if x == z {}
+ | ^^ no implementation for `&str == char`
+ |
+ = help: the trait `PartialEq<char>` is not implemented for `&str`
+ = help: the following other types implement trait `PartialEq<Rhs>`:
+ <&'a str as PartialEq<OsString>>
+ <&'a str as PartialEq<String>>
+ <&'b str as PartialEq<Cow<'a, str>>>
+ <String as PartialEq<&'a str>>
+ <String as PartialEq<Cow<'a, str>>>
+ <String as PartialEq<str>>
+ <String as PartialEq>
+ <str as PartialEq<Cow<'a, str>>>
+ and 4 others
+
+error: aborting due to 6 previous errors
+
+Some errors have detailed explanations: E0277, E0308.
+For more information about an error, try `rustc --explain E0277`.