You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In bitflags/bitflags#166 working on testing bitflags's support for 2018-style macro imports, I found that it would be very helpful to be able to control the choice of edition at the granularity of individual test files. My understanding is that top-level test files are compiled totally independently so I should be able to use different editions across different files. Cargo's edition setting does not provide the granularity needed.
One possible way to do this would be an #![edition = "..."] attribute, similar to the existing #![crate_type = "..."] attribute which also controls something that would ordinarily be passed in the compiler invocation.
@Manishearth as the implementor of #48014 and #48801 may know whether this is feasible. Are there parsing differences between the editions that would absolutely require passing edition in the compiler invocation rather than picking it up from an attribute?
The text was updated successfully, but these errors were encountered:
I believe we're against #![edition] because it makes parsing etc more complicated; I think the way to do this would be to have Cargo have target-level configuration of editions.
It's worth noting that we'll probably want something similar for rustdoc eventually as well (per-test edition settings).
In bitflags/bitflags#166 working on testing bitflags's support for 2018-style macro imports, I found that it would be very helpful to be able to control the choice of edition at the granularity of individual test files. My understanding is that top-level test files are compiled totally independently so I should be able to use different editions across different files. Cargo's
edition
setting does not provide the granularity needed.One possible way to do this would be an
#![edition = "..."]
attribute, similar to the existing#![crate_type = "..."]
attribute which also controls something that would ordinarily be passed in the compiler invocation.@Manishearth as the implementor of #48014 and #48801 may know whether this is feasible. Are there parsing differences between the editions that would absolutely require passing edition in the compiler invocation rather than picking it up from an attribute?
The text was updated successfully, but these errors were encountered: