-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cargo should tell build.rs
what the Rust edition is
#6408
Comments
This may be complicated by the fact that targets within a package can be in different editions. I imagine just including the package edition would cover 99.9% of the situations, but there should be at least a note in the documentation about this potential pitfall. |
I had to go look at the docs because I found this so surprising. |
Turns out I rushed to implementation with #14873 when this feature hasn't been settled yet... I do think we should simply provide the |
My concern with There would be other areas that could potentially benefit from per-mod or per-block editions, like with doctests which are allowed to be per-edition. |
Describe the problem you are trying to solve
Syntax between Rust 2015 and Rust 2018 is different. Generating code in
build.rs
should know what edition of Rust to generate code for.The code could parse
Cargo.toml
to figure this out, but it's cumbersome.Describe the solution you'd like
An environment variable e.g.
RUST_EDITION=2018
would help.The text was updated successfully, but these errors were encountered: