fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

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