File tree 1 file changed +16
-0
lines changed 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,19 @@ impl ICE {
174
174
write ! ( mvce_file, "{}" , mvce_string)
175
175
. expect ( & format ! ( "failed to write mvce '{mvce_display}'" ) ) ;
176
176
177
+ // add feature flags into the mvce
178
+
179
+ // filter and convert ""-Zcrate-attr=feature(x)" to "#![feature(x)]"
180
+ let feature_flags = & ice
181
+ . args
182
+ . clone ( )
183
+ . iter ( )
184
+ . filter ( |flag| flag. starts_with ( "-Zcrate-attr=feature(" ) )
185
+ . map ( |flag| flag. replace ( "-Zcrate-attr=" , "" ) )
186
+ . map ( |feature| format ! ( "#![{feature}]\n " ) )
187
+ . collect :: < String > ( ) ;
188
+ dbg ! ( feature_flags) ;
189
+
177
190
let flags = ice
178
191
. args
179
192
. clone ( )
@@ -216,6 +229,7 @@ impl ICE {
216
229
"snippet:
217
230
````rust
218
231
{original_code}
232
+ {feature_flags}
219
233
````"
220
234
)
221
235
// if we have a very long original snippet. collapse it
@@ -224,6 +238,7 @@ impl ICE {
224
238
"auto-reduced (treereduce-rust):
225
239
````rust
226
240
{mvce_string}
241
+ {feature_flags}
227
242
````
228
243
229
244
<details><summary><strong>original code</strong></summary>
@@ -241,6 +256,7 @@ original:
241
256
"auto-reduced (treereduce-rust):
242
257
````rust
243
258
{mvce_string}
259
+ {feature_flags}
244
260
````
245
261
246
262
original:
You can’t perform that action at this time.
0 commit comments