[REQUEST]: Pre-fill `--edition=2021` for Rust
Is your feature request related to a problem? Please describe
Arguably, users may prefer to compile with the latest Rust edition by default (--edition=2021), instead of the first one (--edition=2015, compiler default).
With the new Rust library support (#3763), this is even more prominent because one needs to compile with the newer edition or manually add extern crate declarations.
Describe the solution you'd like
Pre-fill the compiler flags box with --edition=2021 when a new compilation or execution window is added for the Rust language.
This also allows users to more quickly switch the edition if needed.
Describe alternatives you've considered
Do it by default in the compiler flags.
- The compiler does not allow more than one
--editionflag, thus users would not be able to switch.
Do it by default in the compiler flags, but parse users' flags and, if --edition is detected, do not add the --edition to the base flags.
- Potentially surprising behavior for users.
Add a combobox to select the edition.
- Requires extra UI elements.
Additional context
The Rust Playground does select 2021 as the default edition. Cargo also creates projects with the latest edition by default.
#3100 proposes prefilling by compiler/language (so e.g. --edition 2021 could be such a user) and making these defaults user-configurable.