File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,22 @@ frust-cfg=
8383Rust Joined RejectNegative
8484-frust-cfg=<name> Set a config expansion option
8585
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+
86102o
87103Rust Joined Separate
88104; Documented in common.opt
Original file line number Diff line number Diff line change @@ -373,6 +373,10 @@ Session::handle_option (
373373 break ;
374374 }
375375
376+ case OPT_frust_edition_:
377+ options.set_edition (flag_rust_edition);
378+ break ;
379+
376380 default :
377381 break ;
378382 }
Original file line number Diff line number Diff line change @@ -184,6 +184,13 @@ struct CompileOptions
184184 bool enable_test = false ;
185185 bool debug_assertions = false ;
186186 bool proc_macro = false ;
187+ enum Edition
188+ {
189+ E2015 = 0 ,
190+ E2018 ,
191+ E2021 ,
192+ } edition
193+ = E2015 ;
187194
188195 bool dump_option_enabled (DumpOption option) const
189196 {
@@ -211,6 +218,11 @@ struct CompileOptions
211218 crate_name = std::move (name);
212219 return true ;
213220 }
221+
222+ void set_edition (int raw_edition)
223+ {
224+ edition = static_cast <Edition> (raw_edition);
225+ }
214226};
215227
216228/* Defines a compiler session. This is for a single compiler invocation, so
You can’t perform that action at this time.
0 commit comments