Skip to content

Commit

Permalink
Merge pull request #55 from dtolnay/checkcfg
Browse files Browse the repository at this point in the history
Resolve unexpected_cfgs warning
  • Loading branch information
dtolnay committed May 7, 2024
2 parents 7b7c262 + 6132d8b commit 86b1932
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ categories = ["value-formatting", "no-std", "no-std::no-alloc"]
description = "Fast floating point to string conversion"
documentation = "https://docs.rs/ryu"
edition = "2018"
exclude = ["performance.png", "chart/**"]
exclude = ["build.rs", "performance.png", "chart/**"]
keywords = ["float"]
license = "Apache-2.0 OR BSL-1.0"
repository = "https://github.com/dtolnay/ryu"
Expand Down
7 changes: 7 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fn main() {
// Warning: build.rs is not published to crates.io.

println!("cargo:rustc-cfg=check_cfg");
println!("cargo:rustc-check-cfg=cfg(check_cfg)");
println!("cargo:rustc-check-cfg=cfg(exhaustive)");
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@

#![no_std]
#![doc(html_root_url = "https://docs.rs/ryu/1.0.17")]
#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]
#![allow(
clippy::cast_lossless,
clippy::cast_possible_truncation,
Expand Down

0 comments on commit 86b1932

Please sign in to comment.