]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lexer/lex-bad-char-literals-6.stderr
Rollup merge of #100006 - jyn514:update-copy, r=dtolnay
[rust.git] / src / test / ui / lexer / lex-bad-char-literals-6.stderr
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';
5    |                   ^^^^
6    |
7 help: if you meant to write a `str` literal, use double quotes
8    |
9 LL |     let x: &str = "ab";
10    |                   ~~~~
11
12 error: character literal may only contain one codepoint
13   --> $DIR/lex-bad-char-literals-6.rs:4:19
14    |
15 LL |     let y: char = 'cd';
16    |                   ^^^^
17    |
18 help: if you meant to write a `str` literal, use double quotes
19    |
20 LL |     let y: char = "cd";
21    |                   ~~~~
22
23 error: character literal may only contain one codepoint
24   --> $DIR/lex-bad-char-literals-6.rs:6:13
25    |
26 LL |     let z = 'ef';
27    |             ^^^^
28    |
29 help: if you meant to write a `str` literal, use double quotes
30    |
31 LL |     let z = "ef";
32    |             ~~~~
33
34 error[E0277]: can't compare `&str` with `char`
35   --> $DIR/lex-bad-char-literals-6.rs:9:10
36    |
37 LL |     if x == y {}
38    |          ^^ no implementation for `&str == char`
39    |
40    = help: the trait `PartialEq<char>` is not implemented for `&str`
41    = help: the following other types implement trait `PartialEq<Rhs>`:
42              <&'a str as PartialEq<OsString>>
43              <&'a str as PartialEq<String>>
44              <&'b str as PartialEq<Cow<'a, str>>>
45              <String as PartialEq<&'a str>>
46              <String as PartialEq<Cow<'a, str>>>
47              <String as PartialEq<str>>
48              <String as PartialEq>
49              <str as PartialEq<Cow<'a, str>>>
50            and 4 others
51
52 error[E0308]: mismatched types
53   --> $DIR/lex-bad-char-literals-6.rs:15:20
54    |
55 LL |     let a: usize = "";
56    |            -----   ^^ expected `usize`, found `&str`
57    |            |
58    |            expected due to this
59
60 error[E0277]: can't compare `&str` with `char`
61   --> $DIR/lex-bad-char-literals-6.rs:12:10
62    |
63 LL |     if x == z {}
64    |          ^^ no implementation for `&str == char`
65    |
66    = help: the trait `PartialEq<char>` is not implemented for `&str`
67    = help: the following other types implement trait `PartialEq<Rhs>`:
68              <&'a str as PartialEq<OsString>>
69              <&'a str as PartialEq<String>>
70              <&'b str as PartialEq<Cow<'a, str>>>
71              <String as PartialEq<&'a str>>
72              <String as PartialEq<Cow<'a, str>>>
73              <String as PartialEq<str>>
74              <String as PartialEq>
75              <str as PartialEq<Cow<'a, str>>>
76            and 4 others
77
78 error: aborting due to 6 previous errors
79
80 Some errors have detailed explanations: E0277, E0308.
81 For more information about an error, try `rustc --explain E0277`.