Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--edition should tell what the default edition is #106041

Closed
matthiaskrgr opened this issue Dec 22, 2022 · 6 comments · Fixed by #106542
Closed

--edition should tell what the default edition is #106041

matthiaskrgr opened this issue Dec 22, 2022 · 6 comments · Fixed by #106542
Assignees
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Dec 22, 2022

rustc --edition: error: Argument to option 'edition' missing

rustc --edition=help: error: argument for `--edition` must be one of: 2015|2018|2021|2024. (instead was `help`)

rustc --help

        --edition 2015|2018|2021|2024
                        Specify which edition of the compiler to use when
                        compiling code.

The default is not mentioned anywhere. I assume it is 2015?

@matthiaskrgr matthiaskrgr added the C-bug Category: This is a bug. label Dec 22, 2022
@fmease
Copy link
Member

fmease commented Dec 22, 2022

The default is indeed 2015. It should probably not only mention the default (2015) but also the latest stable edition (2021).

@jyn514 jyn514 added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Dec 22, 2022
@jyn514
Copy link
Member

jyn514 commented Dec 22, 2022

Mentoring instructions: modify

"Specify which edition of the compiler to use when compiling code.",
to include DEFAULT_EDITION and LATEST_STABLE_EDITION somewhere.

@jyn514 jyn514 added the E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. label Dec 22, 2022
@sigaloid
Copy link
Contributor

@rustbot claim

@sigaloid
Copy link
Contributor

What is the best way to insert the values for DEFAULT_EDITION and LATEST_STABLE_EDITION into the string? opt::opt_s only takes &'static str's and I don't see an easy way to create one while inlining those variables. Neither concat! nor format! works - former only accepts literals rather than the static variable, and the latter would create a &str, but then drop a temporary variable.

I don't believe it would be a good idea to simply write the value of these variables into the string, so I'm wondering what other options I have. However, if that's the way forward, I can do so.

@jyn514
Copy link
Member

jyn514 commented Dec 23, 2022

opt::opt_s only takes &'static str's

Where does that requirement come from? Seems fine to loosen it.

@jyn514
Copy link
Member

jyn514 commented Dec 23, 2022

ah I see, the string ends up stored in RustcOptGroup.

Honestly, given that this is only used once and the string is tiny, using Box::leak seems fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
4 participants