-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to use rustc-check-cfg (#340)
* updated to use rustc-check-cfg * allow unstable on nightly * rustfmt * removed duplicate lint * rustfmt * fix code coverage unstable issue * allow unexpected_cfgs lint
- Loading branch information
Showing
19 changed files
with
261 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,40 @@ | ||
pub fn main() { | ||
println!("cargo:rerun-if-changed=build.rs"); | ||
println!("cargo:rustc-check-cfg=cfg(coverage_nightly)"); | ||
nightly(); | ||
beta(); | ||
stable(); | ||
msrv(); | ||
lints_fix(); | ||
} | ||
|
||
#[rustversion::nightly] | ||
fn nightly() { | ||
println!("cargo:rustc-check-cfg=cfg(nightly)"); | ||
println!("cargo:rustc-cfg=nightly"); | ||
} | ||
|
||
#[rustversion::not(nightly)] | ||
fn nightly() {} | ||
fn nightly() { | ||
println!("cargo:rustc-check-cfg=cfg(nightly)"); | ||
} | ||
|
||
#[rustversion::beta] | ||
fn beta() { | ||
println!("cargo:rustc-check-cfg=cfg(beta)"); | ||
println!("cargo:rustc-cfg=beta"); | ||
} | ||
|
||
#[rustversion::not(beta)] | ||
fn beta() {} | ||
fn beta() { | ||
println!("cargo:rustc-check-cfg=cfg(beta)"); | ||
} | ||
|
||
#[rustversion::stable] | ||
fn stable() { | ||
println!("cargo:rustc-check-cfg=cfg(stable)"); | ||
println!("cargo:rustc-cfg=stable"); | ||
} | ||
|
||
#[rustversion::not(stable)] | ||
fn stable() {} | ||
|
||
#[rustversion::before(1.70)] | ||
fn msrv() {} | ||
|
||
#[rustversion::since(1.70)] | ||
fn msrv() { | ||
println!("cargo:rustc-cfg=msrv"); | ||
} | ||
|
||
#[rustversion::before(1.75)] | ||
fn lints_fix() {} | ||
|
||
#[rustversion::since(1.75)] | ||
fn lints_fix() { | ||
println!("cargo:rustc-cfg=lints_fix") | ||
fn stable() { | ||
println!("cargo:rustc-check-cfg=cfg(stable)"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,40 @@ | ||
pub fn main() { | ||
println!("cargo:rerun-if-changed=build.rs"); | ||
println!("cargo:rustc-check-cfg=cfg(coverage_nightly)"); | ||
nightly(); | ||
beta(); | ||
stable(); | ||
msrv(); | ||
lints_fix(); | ||
} | ||
|
||
#[rustversion::nightly] | ||
fn nightly() { | ||
println!("cargo:rustc-check-cfg=cfg(nightly)"); | ||
println!("cargo:rustc-cfg=nightly"); | ||
} | ||
|
||
#[rustversion::not(nightly)] | ||
fn nightly() {} | ||
fn nightly() { | ||
println!("cargo:rustc-check-cfg=cfg(nightly)"); | ||
} | ||
|
||
#[rustversion::beta] | ||
fn beta() { | ||
println!("cargo:rustc-check-cfg=cfg(beta)"); | ||
println!("cargo:rustc-cfg=beta"); | ||
} | ||
|
||
#[rustversion::not(beta)] | ||
fn beta() {} | ||
fn beta() { | ||
println!("cargo:rustc-check-cfg=cfg(beta)"); | ||
} | ||
|
||
#[rustversion::stable] | ||
fn stable() { | ||
println!("cargo:rustc-check-cfg=cfg(stable)"); | ||
println!("cargo:rustc-cfg=stable"); | ||
} | ||
|
||
#[rustversion::not(stable)] | ||
fn stable() {} | ||
|
||
#[rustversion::before(1.70)] | ||
fn msrv() {} | ||
|
||
#[rustversion::since(1.70)] | ||
fn msrv() { | ||
println!("cargo:rustc-cfg=msrv"); | ||
} | ||
|
||
#[rustversion::before(1.75)] | ||
fn lints_fix() {} | ||
|
||
#[rustversion::since(1.75)] | ||
fn lints_fix() { | ||
println!("cargo:rustc-cfg=lints_fix") | ||
fn stable() { | ||
println!("cargo:rustc-check-cfg=cfg(stable)"); | ||
} |
Oops, something went wrong.