@@ -46,18 +46,43 @@ LL | Bar([u8; #[default] 1]),
46
46
|
47
47
= help: consider a manual implementation of `Default`
48
48
49
- error: no default declared
49
+ error[E0665]: `#[derive(Default)]` on enum with no `#[ default]`
50
50
--> $DIR/macros-nonfatal-errors.rs:42:10
51
51
|
52
- LL | #[derive(Default)]
53
- | ^^^^^^^
52
+ LL | #[derive(Default)]
53
+ | ^^^^^^^
54
+ LL | / enum NoDeclaredDefault {
55
+ LL | | Foo,
56
+ LL | | Bar,
57
+ LL | | }
58
+ | |_- this enum needs a unit variant marked with `#[default]`
54
59
|
55
- = help: make a unit variant default by placing `#[default]` above it
56
60
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
61
+ help: make this unit variant default by placing `#[default]` on it
62
+ |
63
+ LL | #[default] Foo,
64
+ | ++++++++++
65
+ help: make this unit variant default by placing `#[default]` on it
66
+ |
67
+ LL | #[default] Bar,
68
+ | ++++++++++
57
69
58
- error: multiple declared defaults
70
+ error[E0665]: `#[derive(Default)]` on enum with no `#[default]`
59
71
--> $DIR/macros-nonfatal-errors.rs:48:10
60
72
|
73
+ LL | #[derive(Default)]
74
+ | ^^^^^^^
75
+ LL | / enum NoDeclaredDefaultWithoutUnitVariant {
76
+ LL | | Foo(i32),
77
+ LL | | Bar(i32),
78
+ LL | | }
79
+ | |_- this enum needs a unit variant marked with `#[default]`
80
+ |
81
+ = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
82
+
83
+ error: multiple declared defaults
84
+ --> $DIR/macros-nonfatal-errors.rs:54:10
85
+ |
61
86
LL | #[derive(Default)]
62
87
| ^^^^^^^
63
88
...
@@ -74,15 +99,15 @@ LL | Baz,
74
99
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
75
100
76
101
error: `#[default]` attribute does not accept a value
77
- --> $DIR/macros-nonfatal-errors.rs:60 :5
102
+ --> $DIR/macros-nonfatal-errors.rs:66 :5
78
103
|
79
104
LL | #[default = 1]
80
105
| ^^^^^^^^^^^^^^
81
106
|
82
107
= help: try using `#[default]`
83
108
84
109
error: multiple `#[default]` attributes
85
- --> $DIR/macros-nonfatal-errors.rs:68 :5
110
+ --> $DIR/macros-nonfatal-errors.rs:74 :5
86
111
|
87
112
LL | #[default]
88
113
| ---------- `#[default]` used here
@@ -93,13 +118,13 @@ LL | Foo,
93
118
|
94
119
= note: only one `#[default]` attribute is needed
95
120
help: try removing this
96
- --> $DIR/macros-nonfatal-errors.rs:67 :5
121
+ --> $DIR/macros-nonfatal-errors.rs:73 :5
97
122
|
98
123
LL | #[default]
99
124
| ^^^^^^^^^^
100
125
101
126
error: multiple `#[default]` attributes
102
- --> $DIR/macros-nonfatal-errors.rs:78 :5
127
+ --> $DIR/macros-nonfatal-errors.rs:84 :5
103
128
|
104
129
LL | #[default]
105
130
| ---------- `#[default]` used here
@@ -111,7 +136,7 @@ LL | Foo,
111
136
|
112
137
= note: only one `#[default]` attribute is needed
113
138
help: try removing these
114
- --> $DIR/macros-nonfatal-errors.rs:75 :5
139
+ --> $DIR/macros-nonfatal-errors.rs:81 :5
115
140
|
116
141
LL | #[default]
117
142
| ^^^^^^^^^^
@@ -121,15 +146,15 @@ LL | #[default]
121
146
| ^^^^^^^^^^
122
147
123
148
error: the `#[default]` attribute may only be used on unit enum variants
124
- --> $DIR/macros-nonfatal-errors.rs:85 :5
149
+ --> $DIR/macros-nonfatal-errors.rs:91 :5
125
150
|
126
151
LL | Foo {},
127
152
| ^^^
128
153
|
129
154
= help: consider a manual implementation of `Default`
130
155
131
156
error: default variant must be exhaustive
132
- --> $DIR/macros-nonfatal-errors.rs:93 :5
157
+ --> $DIR/macros-nonfatal-errors.rs:99 :5
133
158
|
134
159
LL | #[non_exhaustive]
135
160
| ----------------- declared `#[non_exhaustive]` here
@@ -139,37 +164,37 @@ LL | Foo,
139
164
= help: consider a manual implementation of `Default`
140
165
141
166
error: asm template must be a string literal
142
- --> $DIR/macros-nonfatal-errors.rs:98 :10
167
+ --> $DIR/macros-nonfatal-errors.rs:104 :10
143
168
|
144
169
LL | asm!(invalid);
145
170
| ^^^^^^^
146
171
147
172
error: `concat_idents!()` requires ident args
148
- --> $DIR/macros-nonfatal-errors.rs:101 :5
173
+ --> $DIR/macros-nonfatal-errors.rs:107 :5
149
174
|
150
175
LL | concat_idents!("not", "idents");
151
176
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152
177
153
178
error: argument must be a string literal
154
- --> $DIR/macros-nonfatal-errors.rs:103 :17
179
+ --> $DIR/macros-nonfatal-errors.rs:109 :17
155
180
|
156
181
LL | option_env!(invalid);
157
182
| ^^^^^^^
158
183
159
184
error: expected string literal
160
- --> $DIR/macros-nonfatal-errors.rs:104 :10
185
+ --> $DIR/macros-nonfatal-errors.rs:110 :10
161
186
|
162
187
LL | env!(invalid);
163
188
| ^^^^^^^
164
189
165
190
error: `env!()` takes 1 or 2 arguments
166
- --> $DIR/macros-nonfatal-errors.rs:105 :5
191
+ --> $DIR/macros-nonfatal-errors.rs:111 :5
167
192
|
168
193
LL | env!(foo, abr, baz);
169
194
| ^^^^^^^^^^^^^^^^^^^
170
195
171
196
error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined at compile time
172
- --> $DIR/macros-nonfatal-errors.rs:106 :5
197
+ --> $DIR/macros-nonfatal-errors.rs:112 :5
173
198
|
174
199
LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST");
175
200
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -178,7 +203,7 @@ LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST");
178
203
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
179
204
180
205
error: format argument must be a string literal
181
- --> $DIR/macros-nonfatal-errors.rs:108 :13
206
+ --> $DIR/macros-nonfatal-errors.rs:114 :13
182
207
|
183
208
LL | format!(invalid);
184
209
| ^^^^^^^
@@ -189,47 +214,47 @@ LL | format!("{}", invalid);
189
214
| +++++
190
215
191
216
error: argument must be a string literal
192
- --> $DIR/macros-nonfatal-errors.rs:110 :14
217
+ --> $DIR/macros-nonfatal-errors.rs:116 :14
193
218
|
194
219
LL | include!(invalid);
195
220
| ^^^^^^^
196
221
197
222
error: argument must be a string literal
198
- --> $DIR/macros-nonfatal-errors.rs:112 :18
223
+ --> $DIR/macros-nonfatal-errors.rs:118 :18
199
224
|
200
225
LL | include_str!(invalid);
201
226
| ^^^^^^^
202
227
203
228
error: couldn't read `$DIR/i'd be quite surprised if a file with this name existed`: $FILE_NOT_FOUND_MSG
204
- --> $DIR/macros-nonfatal-errors.rs:113 :5
229
+ --> $DIR/macros-nonfatal-errors.rs:119 :5
205
230
|
206
231
LL | include_str!("i'd be quite surprised if a file with this name existed");
207
232
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
208
233
|
209
234
= note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)
210
235
211
236
error: argument must be a string literal
212
- --> $DIR/macros-nonfatal-errors.rs:114 :20
237
+ --> $DIR/macros-nonfatal-errors.rs:120 :20
213
238
|
214
239
LL | include_bytes!(invalid);
215
240
| ^^^^^^^
216
241
217
242
error: couldn't read `$DIR/i'd be quite surprised if a file with this name existed`: $FILE_NOT_FOUND_MSG
218
- --> $DIR/macros-nonfatal-errors.rs:115 :5
243
+ --> $DIR/macros-nonfatal-errors.rs:121 :5
219
244
|
220
245
LL | include_bytes!("i'd be quite surprised if a file with this name existed");
221
246
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
222
247
|
223
248
= note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)
224
249
225
250
error: trace_macros! accepts only `true` or `false`
226
- --> $DIR/macros-nonfatal-errors.rs:117 :5
251
+ --> $DIR/macros-nonfatal-errors.rs:123 :5
227
252
|
228
253
LL | trace_macros!(invalid);
229
254
| ^^^^^^^^^^^^^^^^^^^^^^
230
255
231
256
error: default variant must be exhaustive
232
- --> $DIR/macros-nonfatal-errors.rs:127 :9
257
+ --> $DIR/macros-nonfatal-errors.rs:133 :9
233
258
|
234
259
LL | #[non_exhaustive]
235
260
| ----------------- declared `#[non_exhaustive]` here
@@ -239,10 +264,11 @@ LL | Foo,
239
264
= help: consider a manual implementation of `Default`
240
265
241
266
error: cannot find macro `llvm_asm` in this scope
242
- --> $DIR/macros-nonfatal-errors.rs:99 :5
267
+ --> $DIR/macros-nonfatal-errors.rs:105 :5
243
268
|
244
269
LL | llvm_asm!(invalid);
245
270
| ^^^^^^^^
246
271
247
- error: aborting due to 28 previous errors
272
+ error: aborting due to 29 previous errors
248
273
274
+ For more information about this error, try `rustc --explain E0665`.
0 commit comments