about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2019-09-09 10:59:45 -0500
committerGitHub <noreply@github.com>2019-09-09 10:59:45 -0500
commit709a1dc45a2bf14deff99b9781d1230dad46960e (patch)
tree80146b582e7b8e6ed9cbee20c2e2313cbb87d277
parent3d428bf111e7cc1bec71cf1c74c152469a952e69 (diff)
parent0960b00b10f231a317e125cf454a54a5758670e3 (diff)
downloadrust-709a1dc45a2bf14deff99b9781d1230dad46960e.tar.gz
rust-709a1dc45a2bf14deff99b9781d1230dad46960e.zip
Merge pull request rust-lang/libm#224 from Lokathor/new-CI
Refresh the CI setup
-rw-r--r--library/compiler-builtins/libm/Cargo.toml12
-rw-r--r--library/compiler-builtins/libm/azure-pipelines.yml2
-rwxr-xr-xlibrary/compiler-builtins/libm/ci/run.sh13
-rw-r--r--library/compiler-builtins/libm/crates/libm-bench/Cargo.toml2
-rw-r--r--library/compiler-builtins/libm/src/lib.rs11
-rw-r--r--library/compiler-builtins/libm/src/math/lgamma_r.rs4
-rw-r--r--library/compiler-builtins/libm/src/math/lgammaf_r.rs4
-rw-r--r--library/compiler-builtins/libm/src/math/mod.rs6
-rw-r--r--library/compiler-builtins/libm/src/math/rem_pio2_large.rs4
-rw-r--r--library/compiler-builtins/libm/src/math/sincos.rs4
-rw-r--r--library/compiler-builtins/libm/src/math/sincosf.rs4
11 files changed, 37 insertions, 29 deletions
diff --git a/library/compiler-builtins/libm/Cargo.toml b/library/compiler-builtins/libm/Cargo.toml
index 3e6817851ba..37aff9a765b 100644
--- a/library/compiler-builtins/libm/Cargo.toml
+++ b/library/compiler-builtins/libm/Cargo.toml
@@ -11,18 +11,16 @@ version = "0.2.0"
 edition = "2018"
 
 [features]
-# only used to run our test suite
-default = ['stable']
-stable = []
+default = []
+
+# This tells the compiler to assume that a Nightly toolchain is being used and
+# that it should activate any useful Nightly things accordingly.
+unstable = []
 
 # Generate tests which are random inputs and the outputs are calculated with
 # musl libc.
 musl-reference-tests = ['rand']
 
-# Used checked array indexing instead of unchecked array indexing in this
-# library.
-checked = []
-
 [workspace]
 members = [
   "crates/compiler-builtins-smoke-test",
diff --git a/library/compiler-builtins/libm/azure-pipelines.yml b/library/compiler-builtins/libm/azure-pipelines.yml
index c89346c73d8..0d723c56dd2 100644
--- a/library/compiler-builtins/libm/azure-pipelines.yml
+++ b/library/compiler-builtins/libm/azure-pipelines.yml
@@ -49,8 +49,6 @@ jobs:
         displayName: "Install rust wasm target"
       - script: cargo build --target wasm32-unknown-unknown
         displayName: "Build for wasm"
-      - script: cargo build --target wasm32-unknown-unknown --no-default-features
-        displayName: "Build for wasm (no default features)"
     variables:
       TOOLCHAIN: nightly
 
diff --git a/library/compiler-builtins/libm/ci/run.sh b/library/compiler-builtins/libm/ci/run.sh
index 37ffb8793cc..ed253ab0d10 100755
--- a/library/compiler-builtins/libm/ci/run.sh
+++ b/library/compiler-builtins/libm/ci/run.sh
@@ -3,13 +3,16 @@
 set -ex
 TARGET=$1
 
-CMD="cargo test --all --no-default-features --target $TARGET"
+CMD="cargo test --all --target $TARGET"
 
+# stable by default
 $CMD
 $CMD --release
 
-$CMD --features 'stable'
-$CMD --release --features 'stable'
+# unstable with a feature
+$CMD --features 'unstable'
+$CMD --release --features 'unstable'
 
-$CMD --features 'stable checked musl-reference-tests'
-$CMD --release --features  'stable checked musl-reference-tests'
+# also run the reference tests
+$CMD --features 'unstable musl-reference-tests'
+$CMD --release --features 'unstable musl-reference-tests'
diff --git a/library/compiler-builtins/libm/crates/libm-bench/Cargo.toml b/library/compiler-builtins/libm/crates/libm-bench/Cargo.toml
index ba65dbd5fe6..b09db339b5b 100644
--- a/library/compiler-builtins/libm/crates/libm-bench/Cargo.toml
+++ b/library/compiler-builtins/libm/crates/libm-bench/Cargo.toml
@@ -12,4 +12,4 @@ paste = "0.1.5"
 
 [features]
 default = []
-stable = [ "libm/stable" ]
+unstable = [ "libm/unstable" ]
diff --git a/library/compiler-builtins/libm/src/lib.rs b/library/compiler-builtins/libm/src/lib.rs
index b15857dbe6f..e228af9b333 100644
--- a/library/compiler-builtins/libm/src/lib.rs
+++ b/library/compiler-builtins/libm/src/lib.rs
@@ -2,9 +2,18 @@
 #![deny(warnings)]
 #![no_std]
 #![cfg_attr(
-    all(target_arch = "wasm32", not(feature = "stable")),
+    all(target_arch = "wasm32", feature = "unstable"),
     feature(core_intrinsics)
 )]
+#![allow(clippy::unreadable_literal)]
+#![allow(clippy::many_single_char_names)]
+#![allow(clippy::needless_return)]
+#![allow(clippy::int_plus_one)]
+#![allow(clippy::deprecated_cfg_attr)]
+#![allow(clippy::mixed_case_hex_literals)]
+#![allow(clippy::float_cmp)]
+#![allow(clippy::eq_op)]
+#![allow(clippy::assign_op_pattern)]
 
 mod math;
 
diff --git a/library/compiler-builtins/libm/src/math/lgamma_r.rs b/library/compiler-builtins/libm/src/math/lgamma_r.rs
index 382a501fc3d..9533e882cc9 100644
--- a/library/compiler-builtins/libm/src/math/lgamma_r.rs
+++ b/library/compiler-builtins/libm/src/math/lgamma_r.rs
@@ -270,9 +270,9 @@ pub fn lgamma_r(mut x: f64) -> (f64, i32) {
                 p2 = 1.0 + y * (V1 + y * (V2 + y * (V3 + y * (V4 + y * V5))));
                 r += -0.5 * y + p1 / p2;
             }
-            #[cfg(feature = "checked")]
+            #[cfg(debug_assertions)]
             _ => unreachable!(),
-            #[cfg(not(feature = "checked"))]
+            #[cfg(not(debug_assertions))]
             _ => {}
         }
     } else if ix < 0x40200000 {
diff --git a/library/compiler-builtins/libm/src/math/lgammaf_r.rs b/library/compiler-builtins/libm/src/math/lgammaf_r.rs
index 0745359a257..c5e559f4652 100644
--- a/library/compiler-builtins/libm/src/math/lgammaf_r.rs
+++ b/library/compiler-builtins/libm/src/math/lgammaf_r.rs
@@ -205,9 +205,9 @@ pub fn lgammaf_r(mut x: f32) -> (f32, i32) {
                 p2 = 1.0 + y * (V1 + y * (V2 + y * (V3 + y * (V4 + y * V5))));
                 r += -0.5 * y + p1 / p2;
             }
-            #[cfg(feature = "checked")]
+            #[cfg(debug_assertions)]
             _ => unreachable!(),
-            #[cfg(not(feature = "checked"))]
+            #[cfg(not(debug_assertions))]
             _ => {}
         }
     } else if ix < 0x41000000 {
diff --git a/library/compiler-builtins/libm/src/math/mod.rs b/library/compiler-builtins/libm/src/math/mod.rs
index fcf4e649cde..c8d7bd8194d 100644
--- a/library/compiler-builtins/libm/src/math/mod.rs
+++ b/library/compiler-builtins/libm/src/math/mod.rs
@@ -6,7 +6,7 @@ macro_rules! force_eval {
     };
 }
 
-#[cfg(not(feature = "checked"))]
+#[cfg(not(debug_assertions))]
 macro_rules! i {
     ($array:expr, $index:expr) => {
         unsafe { *$array.get_unchecked($index) }
@@ -36,7 +36,7 @@ macro_rules! i {
     };
 }
 
-#[cfg(feature = "checked")]
+#[cfg(debug_assertions)]
 macro_rules! i {
     ($array:expr, $index:expr) => {
         *$array.get($index).unwrap()
@@ -60,7 +60,7 @@ macro_rules! i {
 
 macro_rules! llvm_intrinsically_optimized {
     (#[cfg($($clause:tt)*)] $e:expr) => {
-        #[cfg(all(not(feature = "stable"), $($clause)*))]
+        #[cfg(all(feature = "unstable", $($clause)*))]
         {
             if true { // thwart the dead code lint
                 $e
diff --git a/library/compiler-builtins/libm/src/math/rem_pio2_large.rs b/library/compiler-builtins/libm/src/math/rem_pio2_large.rs
index 8533dc28948..002ce2e211f 100644
--- a/library/compiler-builtins/libm/src/math/rem_pio2_large.rs
+++ b/library/compiler-builtins/libm/src/math/rem_pio2_large.rs
@@ -461,9 +461,9 @@ pub(crate) fn rem_pio2_large(x: &[f64], y: &mut [f64], e0: i32, prec: usize) ->
                 i!(y, 2, =, -fw);
             }
         }
-        #[cfg(feature = "checked")]
+        #[cfg(debug_assertions)]
         _ => unreachable!(),
-        #[cfg(not(feature = "checked"))]
+        #[cfg(not(debug_assertions))]
         _ => {}
     }
     n & 7
diff --git a/library/compiler-builtins/libm/src/math/sincos.rs b/library/compiler-builtins/libm/src/math/sincos.rs
index 750908df4f7..d49f65c9707 100644
--- a/library/compiler-builtins/libm/src/math/sincos.rs
+++ b/library/compiler-builtins/libm/src/math/sincos.rs
@@ -51,9 +51,9 @@ pub fn sincos(x: f64) -> (f64, f64) {
         1 => (c, -s),
         2 => (-s, -c),
         3 => (-c, s),
-        #[cfg(feature = "checked")]
+        #[cfg(debug_assertions)]
         _ => unreachable!(),
-        #[cfg(not(feature = "checked"))]
+        #[cfg(not(debug_assertions))]
         _ => (0.0, 1.0),
     }
 }
diff --git a/library/compiler-builtins/libm/src/math/sincosf.rs b/library/compiler-builtins/libm/src/math/sincosf.rs
index bb9a0039201..d4e0772d5b1 100644
--- a/library/compiler-builtins/libm/src/math/sincosf.rs
+++ b/library/compiler-builtins/libm/src/math/sincosf.rs
@@ -115,9 +115,9 @@ pub fn sincosf(x: f32) -> (f32, f32) {
         1 => (c, -s),
         2 => (-s, -c),
         3 => (-c, s),
-        #[cfg(feature = "checked")]
+        #[cfg(debug_assertions)]
         _ => unreachable!(),
-        #[cfg(not(feature = "checked"))]
+        #[cfg(not(debug_assertions))]
         _ => (0.0, 1.0),
     }
 }