[REQUEST]: Pre-fill `--edition=2021` for Rust
See original GitHub issueIs 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 (https://github.com/compiler-explorer/compiler-explorer/issues/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
--edition
flag, 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.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:8 (8 by maintainers)
Top GitHub Comments
HLSL when using DXC would also benefit from one of the solutions here.
Right: there’s definitely some UI/UX concerns but a general solution to the “add a default argument, and make it clear to the user it’s there, while letting them change it” would be great.