Skip to content

Commit 630e597

Browse files
---
yaml --- r: 234862 b: refs/heads/stable c: 67c11b0 h: refs/heads/master v: v3
1 parent db5a900 commit 630e597

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
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 0770f665d98c28507746d17c46289f1f9f250f31
32+
refs/heads/stable: 67c11b0146d875260ffd7d44184221e42c01186c
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/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)