@@ -46,18 +46,43 @@ LL | Bar([u8; #[default] 1]),
4646 |
4747 = help: consider a manual implementation of `Default`
4848
49- error: no default declared
49+ error[E0665]: `#[derive(Default)]` on enum with no `#[ default]`
5050 --> $DIR/macros-nonfatal-errors.rs:42:10
5151 |
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]`
5459 |
55- = help: make a unit variant default by placing `#[default]` above it
5660 = 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+ | ++++++++++
5769
58- error: multiple declared defaults
70+ error[E0665]: `#[derive(Default)]` on enum with no `#[default]`
5971 --> $DIR/macros-nonfatal-errors.rs:48:10
6072 |
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+ |
6186LL | #[derive(Default)]
6287 | ^^^^^^^
6388...
@@ -74,15 +99,15 @@ LL | Baz,
7499 = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
75100
76101error: `#[default]` attribute does not accept a value
77- --> $DIR/macros-nonfatal-errors.rs:60 :5
102+ --> $DIR/macros-nonfatal-errors.rs:66 :5
78103 |
79104LL | #[default = 1]
80105 | ^^^^^^^^^^^^^^
81106 |
82107 = help: try using `#[default]`
83108
84109error: multiple `#[default]` attributes
85- --> $DIR/macros-nonfatal-errors.rs:68 :5
110+ --> $DIR/macros-nonfatal-errors.rs:74 :5
86111 |
87112LL | #[default]
88113 | ---------- `#[default]` used here
@@ -93,13 +118,13 @@ LL | Foo,
93118 |
94119 = note: only one `#[default]` attribute is needed
95120help: try removing this
96- --> $DIR/macros-nonfatal-errors.rs:67 :5
121+ --> $DIR/macros-nonfatal-errors.rs:73 :5
97122 |
98123LL | #[default]
99124 | ^^^^^^^^^^
100125
101126error: multiple `#[default]` attributes
102- --> $DIR/macros-nonfatal-errors.rs:78 :5
127+ --> $DIR/macros-nonfatal-errors.rs:84 :5
103128 |
104129LL | #[default]
105130 | ---------- `#[default]` used here
@@ -111,7 +136,7 @@ LL | Foo,
111136 |
112137 = note: only one `#[default]` attribute is needed
113138help: try removing these
114- --> $DIR/macros-nonfatal-errors.rs:75 :5
139+ --> $DIR/macros-nonfatal-errors.rs:81 :5
115140 |
116141LL | #[default]
117142 | ^^^^^^^^^^
@@ -121,15 +146,15 @@ LL | #[default]
121146 | ^^^^^^^^^^
122147
123148error: 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
125150 |
126151LL | Foo {},
127152 | ^^^
128153 |
129154 = help: consider a manual implementation of `Default`
130155
131156error: default variant must be exhaustive
132- --> $DIR/macros-nonfatal-errors.rs:93 :5
157+ --> $DIR/macros-nonfatal-errors.rs:99 :5
133158 |
134159LL | #[non_exhaustive]
135160 | ----------------- declared `#[non_exhaustive]` here
@@ -139,37 +164,37 @@ LL | Foo,
139164 = help: consider a manual implementation of `Default`
140165
141166error: asm template must be a string literal
142- --> $DIR/macros-nonfatal-errors.rs:98 :10
167+ --> $DIR/macros-nonfatal-errors.rs:104 :10
143168 |
144169LL | asm!(invalid);
145170 | ^^^^^^^
146171
147172error: `concat_idents!()` requires ident args
148- --> $DIR/macros-nonfatal-errors.rs:101 :5
173+ --> $DIR/macros-nonfatal-errors.rs:107 :5
149174 |
150175LL | concat_idents!("not", "idents");
151176 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152177
153178error: argument must be a string literal
154- --> $DIR/macros-nonfatal-errors.rs:103 :17
179+ --> $DIR/macros-nonfatal-errors.rs:109 :17
155180 |
156181LL | option_env!(invalid);
157182 | ^^^^^^^
158183
159184error: expected string literal
160- --> $DIR/macros-nonfatal-errors.rs:104 :10
185+ --> $DIR/macros-nonfatal-errors.rs:110 :10
161186 |
162187LL | env!(invalid);
163188 | ^^^^^^^
164189
165190error: `env!()` takes 1 or 2 arguments
166- --> $DIR/macros-nonfatal-errors.rs:105 :5
191+ --> $DIR/macros-nonfatal-errors.rs:111 :5
167192 |
168193LL | env!(foo, abr, baz);
169194 | ^^^^^^^^^^^^^^^^^^^
170195
171196error: 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
173198 |
174199LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST");
175200 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -178,7 +203,7 @@ LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST");
178203 = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
179204
180205error: format argument must be a string literal
181- --> $DIR/macros-nonfatal-errors.rs:108 :13
206+ --> $DIR/macros-nonfatal-errors.rs:114 :13
182207 |
183208LL | format!(invalid);
184209 | ^^^^^^^
@@ -189,47 +214,47 @@ LL | format!("{}", invalid);
189214 | +++++
190215
191216error: argument must be a string literal
192- --> $DIR/macros-nonfatal-errors.rs:110 :14
217+ --> $DIR/macros-nonfatal-errors.rs:116 :14
193218 |
194219LL | include!(invalid);
195220 | ^^^^^^^
196221
197222error: argument must be a string literal
198- --> $DIR/macros-nonfatal-errors.rs:112 :18
223+ --> $DIR/macros-nonfatal-errors.rs:118 :18
199224 |
200225LL | include_str!(invalid);
201226 | ^^^^^^^
202227
203228error: 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
205230 |
206231LL | include_str!("i'd be quite surprised if a file with this name existed");
207232 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
208233 |
209234 = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)
210235
211236error: argument must be a string literal
212- --> $DIR/macros-nonfatal-errors.rs:114 :20
237+ --> $DIR/macros-nonfatal-errors.rs:120 :20
213238 |
214239LL | include_bytes!(invalid);
215240 | ^^^^^^^
216241
217242error: 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
219244 |
220245LL | include_bytes!("i'd be quite surprised if a file with this name existed");
221246 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
222247 |
223248 = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)
224249
225250error: trace_macros! accepts only `true` or `false`
226- --> $DIR/macros-nonfatal-errors.rs:117 :5
251+ --> $DIR/macros-nonfatal-errors.rs:123 :5
227252 |
228253LL | trace_macros!(invalid);
229254 | ^^^^^^^^^^^^^^^^^^^^^^
230255
231256error: default variant must be exhaustive
232- --> $DIR/macros-nonfatal-errors.rs:127 :9
257+ --> $DIR/macros-nonfatal-errors.rs:133 :9
233258 |
234259LL | #[non_exhaustive]
235260 | ----------------- declared `#[non_exhaustive]` here
@@ -239,10 +264,11 @@ LL | Foo,
239264 = help: consider a manual implementation of `Default`
240265
241266error: cannot find macro `llvm_asm` in this scope
242- --> $DIR/macros-nonfatal-errors.rs:99 :5
267+ --> $DIR/macros-nonfatal-errors.rs:105 :5
243268 |
244269LL | llvm_asm!(invalid);
245270 | ^^^^^^^^
246271
247- error: aborting due to 28 previous errors
272+ error: aborting due to 29 previous errors
248273
274+ For more information about this error, try `rustc --explain E0665`.
0 commit comments