-
Notifications
You must be signed in to change notification settings - Fork 1.6k
RFC: #[cfg(version_since(rust, "1.95"))]
for Rust-version conditional compilation
#3857
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
4dbd2d2
ecb3459
236f2a5
2ee3718
20233b0
3d827bc
a24a6a4
5a7c0e9
d392d50
e51caf2
cb8acba
a1a8164
c5e9d5f
465cecc
0fed553
3a7609a
55a7632
545ef52
4352a95
c0a7dc4
ce77858
7ba5578
0d7f46c
b2e8cdb
50e6949
2348d45
6f656d5
21b8dc0
ee1c8cf
ec2e54c
96ffa15
a07e1c6
c386700
741f854
5ee6b1e
95c2998
1b8355a
0ab2847
f1dedc5
7139923
e71bdc1
c12e4a4
28b52e1
b445f73
5eef426
9da21e1
d27c10d
0a839bd
005c608
5d01721
e036b23
940b979
b37fe10
2c3cbe4
75c486b
602eec6
e352338
995eeed
c7ebc40
679116a
5accada
19dca3e
12f6745
303bb64
4347c60
53e0d39
8a57b6b
97d86b6
6241a5d
955a11e
3e89ae8
e544016
3e632bf
5b9fefe
1024808
4031627
2bbed78
56305c3
7561a72
fed559b
459c87b
dbbcab4
bc71f84
94d2438
b3b7c76
be317a1
851d2ed
f461c5b
102adb1
83a393c
fb896af
18a9594
f3b4a69
ae5822c
6b7ec78
1589434
cab1e93
674ec04
be94add
79f50aa
3f765c1
56ddfc3
3519b83
b3bff0f
b4338cb
6703ecd
ff3f075
ce9390b
d089ddd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,7 +283,16 @@ While that isn't always true today (e.g. some Cargo features go from "unknown" w | |
having distinct implementations for different Rust versions can make the testing matrix more complex. | ||
Tools like [`cargo hack`](https://crates.io/crates/cargo-hack) can help which can run commands on not just one toolchain version but also the every version starting with the MSRV with a command like `cargo hack --rust-version --version-step 1 check`. | ||
|
||
This does not help with probes for specific implementations of nightly features which still requires having a `build.rs`. | ||
This does not help with identifying nightlies that a feature is available on or compatible with which will still require a `build.rs`. | ||
In terms of doing this via build probes, | ||
Cargo team has previously rejected support for build probes | ||
([source](https://github.com/rust-lang/cargo/issues/11244#issuecomment-2326780810)). | ||
Whether build probes or nightly version checks, | ||
auto-enabling nightly features | ||
(rather than having users opt-in) | ||
runs counter to the spirit of nightly (works like stable except where you opt-in) | ||
and cause problems if the checks are incorrect which has broken many crates nightly builds in the past | ||
and has even caused friction in changing unstable features within the compiler. | ||
|
||
Libraries could having ticking time bombs that accidentally break or have undesired behavior for some future Rust version that can't be found until we hit that version. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume you mean because of them using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if this is something that could be warn-by-default. Or at least warn-by-default in clippy. The warning would only be an issue when a workspace is worked on by rust versions older than their highest version cfg. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we have any way of detecting this. No toolchain can flag "too new" version requirements, because it's reasonable to detect things newer than that toolchain. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also I would assume this problem already exists with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I expect it will be very common to have a crate that is developed and tested primarily with an old rustc version and then have |
||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.