question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[REQUEST]: Pre-fill `--edition=2021` for Rust

See original GitHub issue

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 (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:open
  • Created a year ago
  • Reactions:2
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ojedacommented, Aug 19, 2022

HLSL when using DXC would also benefit from one of the solutions here.

0reactions
mattgodboltcommented, Aug 19, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rust 2021 - The Rust Edition Guide
The Rust 2021 Edition contains several changes that bring new capabilities and more consistency to the language, and opens up room for expansion...
Read more >
3052-optional-authors-field - The Rust RFC Book
Making the authors field optional will require crates to account for a missing field if they want to work out of the box...
Read more >
I-Bytes Healthcare February Edition 2021 | PDF - Scribd
I-Bytes Healthcare February Edition 2021 - Free download as PDF File ... The company “Prefilled syringes are a fast-growing market for us,” said...
Read more >
Template For Monthly Payment Coupons Copy - mymentalhealthrisk ...
So, gone you require the books swiftly, you can straight get it. ... Valentine's Day Coupon Book - Enginebookmarket Edition 2021-01-10.
Read more >
mozilla-release: changeset 715040 ... - Mercurial
toolkit/library/gtest/rust/Cargo.toml · file | annotate | diff | comparison | ... +edition = "2021" + +[dependencies] +dap_ffi = { path = ".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found