You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/ui/structs/default-field-values-failures.stderr
+16-8
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,11 @@
1
+
error: the `#[default]` attribute may only be used on unit enum variants or variants where every field has a default value
2
+
--> $DIR/default-field-values-failures.rs:47:5
3
+
|
4
+
LL | Variant {}
5
+
| ^^^^^^^
6
+
|
7
+
= help: consider a manual implementation of `Default`
8
+
1
9
error: generic parameters may not be used in const operations
2
10
--> $DIR/default-field-values-failures.rs:22:23
3
11
|
@@ -30,13 +38,13 @@ LL | pub struct S;
30
38
|
31
39
32
40
error: missing mandatory field `bar`
33
-
--> $DIR/default-field-values-failures.rs:47:21
41
+
--> $DIR/default-field-values-failures.rs:53:21
34
42
|
35
43
LL | let _ = Bar { .. };
36
44
| ^
37
45
38
46
error[E0308]: mismatched types
39
-
--> $DIR/default-field-values-failures.rs:51:17
47
+
--> $DIR/default-field-values-failures.rs:57:17
40
48
|
41
49
LL | let _ = Rak(..);
42
50
| --- ^^ expected `i32`, found `RangeFull`
@@ -49,19 +57,19 @@ note: tuple struct defined here
49
57
LL | pub struct Rak(i32 = 42);
50
58
| ^^^
51
59
help: you might have meant to use `..` to skip providing a value for expected fields, but this is only supported on non-tuple struct literals; it is instead interpreted as a `std::ops::RangeFull` literal
52
-
--> $DIR/default-field-values-failures.rs:51:17
60
+
--> $DIR/default-field-values-failures.rs:57:17
53
61
|
54
62
LL | let _ = Rak(..);
55
63
| ^^
56
64
57
65
error[E0061]: this struct takes 1 argument but 2 arguments were supplied
58
-
--> $DIR/default-field-values-failures.rs:53:13
66
+
--> $DIR/default-field-values-failures.rs:59:13
59
67
|
60
68
LL | let _ = Rak(0, ..);
61
69
| ^^^ -- unexpected argument #2 of type `RangeFull`
62
70
|
63
71
help: you might have meant to use `..` to skip providing a value for expected fields, but this is only supported on non-tuple struct literals; it is instead interpreted as a `std::ops::RangeFull` literal
64
-
--> $DIR/default-field-values-failures.rs:53:20
72
+
--> $DIR/default-field-values-failures.rs:59:20
65
73
|
66
74
LL | let _ = Rak(0, ..);
67
75
| ^^
@@ -77,13 +85,13 @@ LL + let _ = Rak(0);
77
85
|
78
86
79
87
error[E0061]: this struct takes 1 argument but 2 arguments were supplied
80
-
--> $DIR/default-field-values-failures.rs:55:13
88
+
--> $DIR/default-field-values-failures.rs:61:13
81
89
|
82
90
LL | let _ = Rak(.., 0);
83
91
| ^^^ -- unexpected argument #1 of type `RangeFull`
84
92
|
85
93
help: you might have meant to use `..` to skip providing a value for expected fields, but this is only supported on non-tuple struct literals; it is instead interpreted as a `std::ops::RangeFull` literal
86
-
--> $DIR/default-field-values-failures.rs:55:17
94
+
--> $DIR/default-field-values-failures.rs:61:17
87
95
|
88
96
LL | let _ = Rak(.., 0);
89
97
| ^^
@@ -104,7 +112,7 @@ error: generic `Self` types are currently not permitted in anonymous constants
104
112
LL | bar: S = Self::S,
105
113
| ^^^^
106
114
107
-
error: aborting due to 8 previous errors
115
+
error: aborting due to 9 previous errors
108
116
109
117
Some errors have detailed explanations: E0061, E0277, E0308.
110
118
For more information about an error, try `rustc --explain E0061`.
0 commit comments