Skip to content

Edition key should be per-target, not per-package #5661

New issue

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

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

Already on GitHub? # to your account

Closed
nrc opened this issue Jun 27, 2018 · 3 comments · Fixed by #5816
Closed

Edition key should be per-target, not per-package #5661

nrc opened this issue Jun 27, 2018 · 3 comments · Fixed by #5816
Labels
P-high Priority: High

Comments

@nrc
Copy link
Member

nrc commented Jun 27, 2018

Possibly optionally?

@nrc nrc added P-high Priority: High Rust-2018 labels Jun 27, 2018
@alexcrichton
Copy link
Member

Seems plausible to me! That way existing crates could migrate one Target at a time instead of all at once

@dtolnay
Copy link
Member

dtolnay commented Jul 29, 2018

@dwijnand or @nrc, could you clarify for someone who is not familiar with Cargo what counts as a "target"? Would this allow selecting an edition at the granularity of individual top-level test files, or would that be a different feature request?

[[test]]
name = "rust2018"
edition = "2018"

I am interested in being able to test bitflags's support for being used in 2018-style macro imports, while keeping our existing 2015-style tests. See bitflags/bitflags#167.

@alexcrichton
Copy link
Member

@dtolnay your exact PR to bitflags is actually what @dwijnand's PR is enabling.

"Targets" in Cargo are basically the same thing as "rustc invocations" or crates, so things like unit tests, libraries, binaries, examples, unit tests for librararies, etc, are all different targets.

bors added a commit that referenced this issue Jul 31, 2018
Edition key should be per-target, not per-package

Fixes #5661

I've pushed this WIP PR as I'd love some early feedback on it and some tips on:

* how to best to make it fail if edition is set on a target, but the feature isn't set; and
* what tests this should include (i.e how exhaustive should I go)

Thanks!
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
P-high Priority: High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants