Skip to content

Commit 219220c

Browse files
---
yaml --- r: 227791 b: refs/heads/try c: 67c11b0 h: refs/heads/master i: 227789: 0462134 227787: b27e420 227783: 53be8e2 227775: d208b7f v: v3
1 parent 373a7bb commit 219220c

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 0770f665d98c28507746d17c46289f1f9f250f31
4+
refs/heads/try: 67c11b0146d875260ffd7d44184221e42c01186c
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc_typeck/diagnostics.rs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,38 @@ fn some_func(x: &mut i32) {
746746
```
747747
"##,
748748

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+
749781
E0072: r##"
750782
When defining a recursive struct or enum, any use of the type being defined
751783
from inside the definition must occur behind a pointer (like `Box` or `&`).
@@ -1505,7 +1537,6 @@ register_diagnostics! {
15051537
E0035, // does not take type parameters
15061538
E0036, // incorrect number of type parameters given for this method
15071539
E0068,
1508-
E0071,
15091540
E0074,
15101541
E0075,
15111542
E0076,

0 commit comments

Comments
 (0)