blob: ce41942467cea1a9fb34bcfe201485e2cbd3bd34 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
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>>>
<str as PartialEq<Cow<'a, str>>>
<str as PartialEq<OsStr>>
<str as PartialEq<OsString>>
<str as PartialEq<String>>
<str as PartialEq>
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>>>
<str as PartialEq<Cow<'a, str>>>
<str as PartialEq<OsStr>>
<str as PartialEq<OsString>>
<str as PartialEq<String>>
<str as PartialEq>
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
|