@@ -380,6 +380,22 @@ fn main() {
380
380
```
381
381
"## ,
382
382
383
+ E0044 : r##"
384
+ You can't use type parameters on foreign items. Example of erroneous code:
385
+
386
+ ```
387
+ extern { fn some_func<T>(x: T); }
388
+ ```
389
+
390
+ To fix this, replace the type parameter with the specializations that you
391
+ need:
392
+
393
+ ```
394
+ extern { fn some_func_i32(x: i32); }
395
+ extern { fn some_func_i64(x: i64); }
396
+ ```
397
+ "## ,
398
+
383
399
E0045 : r##"
384
400
Rust only supports variadic parameters for interoperability with C code in its
385
401
FFI. As such, variadic parameters can only be used with functions which are
@@ -733,6 +749,44 @@ fn some_func(x: &mut i32) {
733
749
```
734
750
"## ,
735
751
752
+ E0071 : r##"
753
+ You tried to use a structure initialization with a non-structure type.
754
+ Example of erroneous code:
755
+
756
+ ```
757
+ enum Foo { FirstValue };
758
+
759
+ let u = Foo::FirstValue { value: 0i32 }; // error: Foo::FirstValue
760
+ // isn't a structure!
761
+ // or even simpler, if the structure wasn't defined at all:
762
+ let u = RandomName { random_field: 0i32 }; // error: RandomName
763
+ // isn't a structure!
764
+ ```
765
+
766
+ To fix this, please check:
767
+ * Did you spell it right?
768
+ * Did you accidentaly used an enum as a struct?
769
+ * Did you accidentaly make an enum when you intended to use a struct?
770
+
771
+ Here is the previous code with all missing information:
772
+
773
+ ```
774
+ struct Inner {
775
+ value: i32
776
+ }
777
+
778
+ enum Foo {
779
+ FirstValue(Inner)
780
+ }
781
+
782
+ fn main() {
783
+ let u = Foo::FirstValue(Inner { value: 0i32 });
784
+
785
+ let t = Inner { value: 0i32 };
786
+ }
787
+ ```
788
+ "## ,
789
+
736
790
E0072 : r##"
737
791
When defining a recursive struct or enum, any use of the type being defined
738
792
from inside the definition must occur behind a pointer (like `Box` or `&`).
@@ -1488,9 +1542,7 @@ For more information see the [opt-in builtin traits RFC](https://github.com/rust
1488
1542
}
1489
1543
1490
1544
register_diagnostics ! {
1491
- E0044 , // foreign items may not have type parameters
1492
1545
E0068 ,
1493
- E0071 ,
1494
1546
E0074 ,
1495
1547
E0075 ,
1496
1548
E0076 ,
0 commit comments