File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed
branches/stable/src/librustc_typeck Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
29
29
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
30
30
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
31
31
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32
- refs/heads/stable: 0770f665d98c28507746d17c46289f1f9f250f31
32
+ refs/heads/stable: 67c11b0146d875260ffd7d44184221e42c01186c
33
33
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
34
34
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
35
35
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e
Original file line number Diff line number Diff line change @@ -746,6 +746,38 @@ fn some_func(x: &mut i32) {
746
746
```
747
747
"## ,
748
748
749
+ E0071 : r##"
750
+ You tried to use a structure initialization with a non-structure type.
751
+ Example of erroneous code:
752
+
753
+ ```
754
+ enum Foo { f };
755
+
756
+ let u = Foo::f { value: 0i32 }; // error: Foo:f isn't a structure!
757
+ // or even more simple:
758
+ let u = t { random_field: 0i32 }; //error: t isn't a structure!
759
+ ```
760
+
761
+ To fix this error, please declare the structure with the given name
762
+ first:
763
+
764
+ ```
765
+ struct Inner {
766
+ value: i32
767
+ }
768
+
769
+ enum Foo {
770
+ f(Inner)
771
+ }
772
+
773
+ fn main() {
774
+ let u = Foo::f(Inner { value: 0i32 });
775
+ // or even more simple:
776
+ let t = Inner { value: 0i32 };
777
+ }
778
+ ```
779
+ "## ,
780
+
749
781
E0072 : r##"
750
782
When defining a recursive struct or enum, any use of the type being defined
751
783
from inside the definition must occur behind a pointer (like `Box` or `&`).
@@ -1505,7 +1537,6 @@ register_diagnostics! {
1505
1537
E0035 , // does not take type parameters
1506
1538
E0036 , // incorrect number of type parameters given for this method
1507
1539
E0068 ,
1508
- E0071 ,
1509
1540
E0074 ,
1510
1541
E0075 ,
1511
1542
E0076 ,
You can’t perform that action at this time.
0 commit comments