Skip to content

Commit 0ff6935

Browse files
committed
Trust the "i128" feature
If the "i128" feature is explicity requested, don't bother probing for it. It will still cause a build error if that was set improperly.
1 parent 3196236 commit 0ff6935

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

build.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ use std::env;
44

55
fn main() {
66
let ac = autocfg::new();
7-
if ac.probe_type("i128") {
8-
println!("cargo:rustc-cfg=has_i128");
9-
} else if env::var_os("CARGO_FEATURE_I128").is_some() {
10-
panic!("i128 support was not detected!");
7+
8+
// If the "i128" feature is explicity requested, don't bother probing for it.
9+
// It will still cause a build error if that was set improperly.
10+
if env::var_os("CARGO_FEATURE_I128").is_some() || ac.probe_type("i128") {
11+
autocfg::emit("has_i128");
1112
}
13+
1214
ac.emit_expression_cfg(
1315
"unsafe { 1f64.to_int_unchecked::<i32>() }",
1416
"has_to_int_unchecked",

0 commit comments

Comments
 (0)