blob: 3d27149f0dcf13704a737b6541e94009b4800c7c (
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
80
81
82
83
|
error[E0308]: mismatched types
--> $DIR/type-mismatch-byte-literal.rs:7:18
|
LL | let _x: u8 = 'X';
| -- ^^^ expected `u8`, found `char`
| |
| expected due to this
|
help: if you meant to write a byte literal, prefix with `b`
|
LL | let _x: u8 = b'X';
| ~~~~
error[E0308]: mismatched types
--> $DIR/type-mismatch-byte-literal.rs:11:9
|
LL | foo('#');
| --- ^^^ expected `u8`, found `char`
| |
| arguments to this function are incorrect
|
note: function defined here
--> $DIR/type-mismatch-byte-literal.rs:4:4
|
LL | fn foo(_t: u8) {}
| ^^^ ------
help: if you meant to write a byte literal, prefix with `b`
|
LL | foo(b'#');
| ~~~~
error[E0308]: mismatched types
--> $DIR/type-mismatch-byte-literal.rs:15:18
|
LL | let _a: u8 = '\x20';
| -- ^^^^^^ expected `u8`, found `char`
| |
| expected due to this
|
help: if you meant to write a byte literal, prefix with `b`
|
LL | let _a: u8 = b'\x20';
| ~~~~~~~
error[E0308]: mismatched types
--> $DIR/type-mismatch-byte-literal.rs:20:9
|
LL | foo('\u{0080}');
| --- ^^^^^^^^^^ expected `u8`, found `char`
| |
| arguments to this function are incorrect
|
note: function defined here
--> $DIR/type-mismatch-byte-literal.rs:4:4
|
LL | fn foo(_t: u8) {}
| ^^^ ------
error[E0308]: mismatched types
--> $DIR/type-mismatch-byte-literal.rs:24:18
|
LL | let _t: u8 = '€';
| -- ^^^ expected `u8`, found `char`
| |
| expected due to this
error[E0308]: mismatched types
--> $DIR/type-mismatch-byte-literal.rs:28:9
|
LL | foo('\u{1f980}');
| --- ^^^^^^^^^^^ expected `u8`, found `char`
| |
| arguments to this function are incorrect
|
note: function defined here
--> $DIR/type-mismatch-byte-literal.rs:4:4
|
LL | fn foo(_t: u8) {}
| ^^^ ------
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0308`.
|