File tree 3 files changed +32
-0
lines changed
3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,22 @@ frust-cfg=
83
83
Rust Joined RejectNegative
84
84
-frust-cfg=<name> Set a config expansion option
85
85
86
+ frust-edition=
87
+ Rust Joined RejectNegative Enum(frust_edition) Var(flag_rust_edition)
88
+ -frust-edition=[2015|2018|2021] Choose which edition to use when compiling rust code
89
+
90
+ Enum
91
+ Name(frust_edition) Type(int) UnknownError(unknown rust edition %qs)
92
+
93
+ EnumValue
94
+ Enum(frust_edition) String(2015) Value(0)
95
+
96
+ EnumValue
97
+ Enum(frust_edition) String(2018) Value(1)
98
+
99
+ EnumValue
100
+ Enum(frust_edition) String(2021) Value(2)
101
+
86
102
o
87
103
Rust Joined Separate
88
104
; Documented in common.opt
Original file line number Diff line number Diff line change @@ -373,6 +373,10 @@ Session::handle_option (
373
373
break ;
374
374
}
375
375
376
+ case OPT_frust_edition_:
377
+ options.set_edition (flag_rust_edition);
378
+ break ;
379
+
376
380
default :
377
381
break ;
378
382
}
Original file line number Diff line number Diff line change @@ -184,6 +184,13 @@ struct CompileOptions
184
184
bool enable_test = false ;
185
185
bool debug_assertions = false ;
186
186
bool proc_macro = false ;
187
+ enum Edition
188
+ {
189
+ E2015 = 0 ,
190
+ E2018 ,
191
+ E2021 ,
192
+ } edition
193
+ = E2015 ;
187
194
188
195
bool dump_option_enabled (DumpOption option) const
189
196
{
@@ -211,6 +218,11 @@ struct CompileOptions
211
218
crate_name = std::move (name);
212
219
return true ;
213
220
}
221
+
222
+ void set_edition (int raw_edition)
223
+ {
224
+ edition = static_cast <Edition> (raw_edition);
225
+ }
214
226
};
215
227
216
228
/* Defines a compiler session. This is for a single compiler invocation, so
You can’t perform that action at this time.
0 commit comments