forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharrays-and-slices.stderr
84 lines (78 loc) · 3.14 KB
/
arrays-and-slices.stderr
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
84
error[E0308]: mismatched types
--> $DIR/arrays-and-slices.rs:18:9
|
LL | const BSTR_SIZED: &'static [u8; 3] = b"012";
| ---------------------------------- constant defined here
...
LL | match BSTR_UNSIZED {
| ------------ this expression has type `&[u8]`
LL | BSTR_SIZED => {}
| ^^^^^^^^^^
| |
| expected `&[u8]`, found `&[u8; 3]`
| `BSTR_SIZED` is interpreted as a constant, not a new binding
| help: introduce a new binding instead: `other_bstr_sized`
|
= note: expected reference `&[u8]`
found reference `&'static [u8; 3]`
error[E0308]: mismatched types
--> $DIR/arrays-and-slices.rs:23:9
|
LL | const STRUCT_SIZED: &'static SomeStruct<[u8; 3]> = &SomeStruct(*BSTR_SIZED);
| ------------------------------------------------ constant defined here
...
LL | match STRUCT_UNSIZED {
| -------------- this expression has type `&SomeStruct<[u8]>`
LL | STRUCT_SIZED => {}
| ^^^^^^^^^^^^
| |
| expected `&SomeStruct<[u8]>`, found `&SomeStruct<[u8; 3]>`
| `STRUCT_SIZED` is interpreted as a constant, not a new binding
| help: introduce a new binding instead: `other_struct_sized`
|
= note: expected reference `&SomeStruct<[u8]>`
found reference `&'static SomeStruct<[u8; 3]>`
error[E0308]: mismatched types
--> $DIR/arrays-and-slices.rs:30:9
|
LL | const BSTR_SIZED: &'static [u8; 3] = b"012";
| ---------------------------------- constant defined here
...
LL | match BSTR_UNSIZED {
| ------------ this expression has type `&[u8]`
LL | BSTR_SIZED => {}
| ^^^^^^^^^^
| |
| expected `&[u8]`, found `&[u8; 3]`
| `BSTR_SIZED` is interpreted as a constant, not a new binding
| help: introduce a new binding instead: `other_bstr_sized`
|
= note: expected reference `&[u8]`
found reference `&'static [u8; 3]`
error[E0308]: mismatched types
--> $DIR/arrays-and-slices.rs:37:9
|
LL | const STRUCT_SIZED: &'static SomeStruct<[u8; 3]> = &SomeStruct(*BSTR_SIZED);
| ------------------------------------------------ constant defined here
...
LL | match STRUCT_UNSIZED {
| -------------- this expression has type `&SomeStruct<[u8]>`
LL | STRUCT_SIZED => {}
| ^^^^^^^^^^^^
| |
| expected `&SomeStruct<[u8]>`, found `&SomeStruct<[u8; 3]>`
| `STRUCT_SIZED` is interpreted as a constant, not a new binding
| help: introduce a new binding instead: `other_struct_sized`
|
= note: expected reference `&SomeStruct<[u8]>`
found reference `&'static SomeStruct<[u8; 3]>`
error: cannot use unsized non-slice type `SomeStruct<[u8]>` in constant patterns
--> $DIR/arrays-and-slices.rs:47:9
|
LL | const STRUCT_UNSIZED: &'static SomeStruct<[u8]> = STRUCT_SIZED;
| ----------------------------------------------- constant defined here
...
LL | STRUCT_UNSIZED => {}
| ^^^^^^^^^^^^^^
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0308`.