File tree 1 file changed +52
-2
lines changed
1 file changed +52
-2
lines changed Original file line number Diff line number Diff line change @@ -1779,6 +1779,58 @@ fn(isize, *const *const u8) -> isize;
1779
1779
```
1780
1780
"## ,
1781
1781
1782
+ E0163 : r##"
1783
+ This error means that an attempt was made to match an enum variant as a
1784
+ struct type when the variant isn't a struct type:
1785
+
1786
+ ```
1787
+ enum Foo { B(u32) }
1788
+
1789
+ fn bar(foo: Foo) -> u32 {
1790
+ match foo {
1791
+ Foo::B{i} => i // error 0163
1792
+ }
1793
+ }
1794
+ ```
1795
+
1796
+ Try using `()` instead:
1797
+
1798
+ ```
1799
+ fn bar(foo: Foo) -> u32 {
1800
+ match foo {
1801
+ Foo::B(i) => i
1802
+ }
1803
+ }
1804
+ ```
1805
+ "## ,
1806
+
1807
+ E0164 : r##"
1808
+
1809
+ This error means that an attempt was made to match a struct type enum
1810
+ variant as a non-struct type:
1811
+
1812
+ ```
1813
+ enum Foo { B{ i: u32 } }
1814
+
1815
+ fn bar(foo: Foo) -> u32 {
1816
+ match foo {
1817
+ Foo::B(i) => i // error 0164
1818
+ }
1819
+ }
1820
+ ```
1821
+
1822
+ Try using `{}` isntead:
1823
+
1824
+ ```
1825
+ fn bar(foo: Foo) -> u32 {
1826
+ match foo {
1827
+ Foo::B{i} => i
1828
+ }
1829
+ }
1830
+ ```
1831
+ "## ,
1832
+
1833
+
1782
1834
E0166 : r##"
1783
1835
This error means that the compiler found a return expression in a function
1784
1836
marked as diverging. A function diverges if it has `!` in the place of the
@@ -3293,8 +3345,6 @@ register_diagnostics! {
3293
3345
// E0129,
3294
3346
// E0141,
3295
3347
// E0159, // use of trait `{}` as struct constructor
3296
- E0163 ,
3297
- E0164 ,
3298
3348
E0167 ,
3299
3349
// E0168,
3300
3350
// E0173, // manual implementations of unboxed closure traits are experimental
You can’t perform that action at this time.
0 commit comments