]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/lex-bad-char-literals-6.stderr
Rollup merge of #60443 - RalfJung:as_ptr, r=SimonSapin
[rust.git] / src / test / ui / parser / 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 help: if you meant to write a `str` literal, use double quotes
7    |
8 LL |     let x: &str = "ab";
9    |                   ^^^^
10
11 error: character literal may only contain one codepoint
12   --> $DIR/lex-bad-char-literals-6.rs:4:19
13    |
14 LL |     let y: char = 'cd';
15    |                   ^^^^
16 help: if you meant to write a `str` literal, use double quotes
17    |
18 LL |     let y: char = "cd";
19    |                   ^^^^
20
21 error: character literal may only contain one codepoint
22   --> $DIR/lex-bad-char-literals-6.rs:6:13
23    |
24 LL |     let z = 'ef';
25    |             ^^^^
26 help: if you meant to write a `str` literal, use double quotes
27    |
28 LL |     let z = "ef";
29    |             ^^^^
30
31 error[E0277]: can't compare `&str` with `char`
32   --> $DIR/lex-bad-char-literals-6.rs:9:10
33    |
34 LL |     if x == y {}
35    |          ^^ no implementation for `&str == char`
36    |
37    = help: the trait `std::cmp::PartialEq<char>` is not implemented for `&str`
38
39 error[E0308]: mismatched types
40   --> $DIR/lex-bad-char-literals-6.rs:15:20
41    |
42 LL |     let a: usize = "";
43    |                    ^^ expected usize, found reference
44    |
45    = note: expected type `usize`
46               found type `&'static str`
47
48 error[E0277]: can't compare `&str` with `char`
49   --> $DIR/lex-bad-char-literals-6.rs:12:10
50    |
51 LL |     if x == z {}
52    |          ^^ no implementation for `&str == char`
53    |
54    = help: the trait `std::cmp::PartialEq<char>` is not implemented for `&str`
55
56 error: aborting due to 6 previous errors
57
58 Some errors have detailed explanations: E0277, E0308.
59 For more information about an error, try `rustc --explain E0277`.