File tree 1 file changed +31
-1
lines changed
1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -3980,6 +3980,37 @@ impl SpaceLlama for i32 {
3980
3980
```
3981
3981
"## ,
3982
3982
3983
+ E0529 : r##"
3984
+ An array or slice pattern was matched against some other type.
3985
+
3986
+ Example of erroneous code:
3987
+
3988
+ ```compile_fail,E0529
3989
+ #![feature(slice_patterns)]
3990
+
3991
+ let r: f32 = 1.0;
3992
+ match r {
3993
+ [a, b] => { // error: expected an array or slice, found `f32`
3994
+ println!("a={}, b={}", a, b);
3995
+ }
3996
+ }
3997
+ ```
3998
+
3999
+ Ensure that the pattern and the expression being matched on are of consistent
4000
+ types:
4001
+
4002
+ ```
4003
+ #![feature(slice_patterns)]
4004
+
4005
+ let r = [1.0, 2.0];
4006
+ match r {
4007
+ [a, b] => { // ok!
4008
+ println!("a={}, b={}", a, b);
4009
+ }
4010
+ }
4011
+ ```
4012
+ "## ,
4013
+
3983
4014
E0559 : r##"
3984
4015
An unknown field was specified into an enum's structure variant.
3985
4016
@@ -4102,6 +4133,5 @@ register_diagnostics! {
4102
4133
E0521 , // redundant default implementations of trait
4103
4134
E0527 , // expected {} elements, found {}
4104
4135
E0528 , // expected at least {} elements, found {}
4105
- E0529 , // slice pattern expects array or slice, not `{}`
4106
4136
E0533 , // `{}` does not name a unit variant, unit struct or a constant
4107
4137
}
You can’t perform that action at this time.
0 commit comments