about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorjoboet <jonasboettiger@icloud.com>2024-01-18 20:33:29 +0100
committerjoboet <jonasboettiger@icloud.com>2024-01-22 15:30:54 +0100
commitf88e64343e4f9c9ec40c5e7c2c0bcd27ff6052bd (patch)
tree5e2614023ffdc0483363780ad04b34dcc024ba4b /library/std/src
parent6fff796eac247c072ddb84f8202bedecc8e94f0d (diff)
downloadrust-f88e64343e4f9c9ec40c5e7c2c0bcd27ff6052bd.tar.gz
rust-f88e64343e4f9c9ec40c5e7c2c0bcd27ff6052bd.zip
std: move cmath into `sys`
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/sys/cmath/builtins.rs (renamed from library/std/src/sys/pal/unix/cmath.rs)2
-rw-r--r--library/std/src/sys/cmath/mod.rs11
-rw-r--r--library/std/src/sys/cmath/windows.rs (renamed from library/std/src/sys/pal/windows/cmath.rs)2
-rw-r--r--library/std/src/sys/mod.rs4
-rw-r--r--library/std/src/sys/pal/hermit/mod.rs2
-rw-r--r--library/std/src/sys/pal/sgx/mod.rs2
-rw-r--r--library/std/src/sys/pal/solid/mod.rs2
-rw-r--r--library/std/src/sys/pal/teeos/mod.rs2
-rw-r--r--library/std/src/sys/pal/uefi/mod.rs2
-rw-r--r--library/std/src/sys/pal/unix/mod.rs2
-rw-r--r--library/std/src/sys/pal/unsupported/mod.rs2
-rw-r--r--library/std/src/sys/pal/wasi/mod.rs2
-rw-r--r--library/std/src/sys/pal/wasm/mod.rs2
-rw-r--r--library/std/src/sys/pal/windows/mod.rs1
-rw-r--r--library/std/src/sys/pal/xous/mod.rs2
15 files changed, 14 insertions, 26 deletions
diff --git a/library/std/src/sys/pal/unix/cmath.rs b/library/std/src/sys/cmath/builtins.rs
index 5346d229116..c680132efa4 100644
--- a/library/std/src/sys/pal/unix/cmath.rs
+++ b/library/std/src/sys/cmath/builtins.rs
@@ -1,5 +1,3 @@
-#![cfg(not(test))]
-
 // These symbols are all defined by `libm`,
 // or by `compiler-builtins` on unsupported platforms.
 
diff --git a/library/std/src/sys/cmath/mod.rs b/library/std/src/sys/cmath/mod.rs
new file mode 100644
index 00000000000..79d5021dd8d
--- /dev/null
+++ b/library/std/src/sys/cmath/mod.rs
@@ -0,0 +1,11 @@
+#![cfg(not(test))]
+
+cfg_if::cfg_if! {
+    if #[cfg(target_os = "windows")] {
+        mod windows;
+        pub use windows::*;
+    } else {
+        mod builtins;
+        pub use builtins::*;
+    }
+}
diff --git a/library/std/src/sys/pal/windows/cmath.rs b/library/std/src/sys/cmath/windows.rs
index 36578d5a34e..712097f06ff 100644
--- a/library/std/src/sys/pal/windows/cmath.rs
+++ b/library/std/src/sys/cmath/windows.rs
@@ -1,5 +1,3 @@
-#![cfg(not(test))]
-
 use core::ffi::{c_double, c_float, c_int};
 
 extern "C" {
diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs
index d95c0d8d062..e03e98b18d2 100644
--- a/library/std/src/sys/mod.rs
+++ b/library/std/src/sys/mod.rs
@@ -3,9 +3,11 @@
 /// descriptors.
 mod pal;
 
-pub mod os_str;
 mod personality;
 
+pub mod cmath;
+pub mod os_str;
+
 // FIXME(117276): remove this, move feature implementations into individual
 //                submodules.
 pub use pal::*;
diff --git a/library/std/src/sys/pal/hermit/mod.rs b/library/std/src/sys/pal/hermit/mod.rs
index 50336296919..3c83afa280b 100644
--- a/library/std/src/sys/pal/hermit/mod.rs
+++ b/library/std/src/sys/pal/hermit/mod.rs
@@ -19,8 +19,6 @@ use crate::os::raw::c_char;
 
 pub mod alloc;
 pub mod args;
-#[path = "../unix/cmath.rs"]
-pub mod cmath;
 pub mod env;
 pub mod fd;
 pub mod fs;
diff --git a/library/std/src/sys/pal/sgx/mod.rs b/library/std/src/sys/pal/sgx/mod.rs
index 893c5f765a7..a769fc1ef59 100644
--- a/library/std/src/sys/pal/sgx/mod.rs
+++ b/library/std/src/sys/pal/sgx/mod.rs
@@ -13,8 +13,6 @@ mod waitqueue;
 
 pub mod alloc;
 pub mod args;
-#[path = "../unix/cmath.rs"]
-pub mod cmath;
 pub mod env;
 pub mod fd;
 #[path = "../unsupported/fs.rs"]
diff --git a/library/std/src/sys/pal/solid/mod.rs b/library/std/src/sys/pal/solid/mod.rs
index 5742ce9d72c..46699e64169 100644
--- a/library/std/src/sys/pal/solid/mod.rs
+++ b/library/std/src/sys/pal/solid/mod.rs
@@ -21,8 +21,6 @@ mod itron {
 pub mod alloc;
 #[path = "../unsupported/args.rs"]
 pub mod args;
-#[path = "../unix/cmath.rs"]
-pub mod cmath;
 pub mod env;
 // `error` is `pub(crate)` so that it can be accessed by `itron/error.rs` as
 // `crate::sys::error`
diff --git a/library/std/src/sys/pal/teeos/mod.rs b/library/std/src/sys/pal/teeos/mod.rs
index 764a4e6ad35..95a5b97ea42 100644
--- a/library/std/src/sys/pal/teeos/mod.rs
+++ b/library/std/src/sys/pal/teeos/mod.rs
@@ -11,8 +11,6 @@ pub use self::rand::hashmap_random_keys;
 pub mod alloc;
 #[path = "../unsupported/args.rs"]
 pub mod args;
-#[path = "../unix/cmath.rs"]
-pub mod cmath;
 #[path = "../unsupported/env.rs"]
 pub mod env;
 pub mod locks;
diff --git a/library/std/src/sys/pal/uefi/mod.rs b/library/std/src/sys/pal/uefi/mod.rs
index fb1a531182a..9ee753aa1a0 100644
--- a/library/std/src/sys/pal/uefi/mod.rs
+++ b/library/std/src/sys/pal/uefi/mod.rs
@@ -14,8 +14,6 @@
 
 pub mod alloc;
 pub mod args;
-#[path = "../unix/cmath.rs"]
-pub mod cmath;
 pub mod env;
 #[path = "../unsupported/fs.rs"]
 pub mod fs;
diff --git a/library/std/src/sys/pal/unix/mod.rs b/library/std/src/sys/pal/unix/mod.rs
index 86027c2b0b0..43cb9d89be9 100644
--- a/library/std/src/sys/pal/unix/mod.rs
+++ b/library/std/src/sys/pal/unix/mod.rs
@@ -11,8 +11,6 @@ pub mod weak;
 pub mod alloc;
 pub mod android;
 pub mod args;
-#[path = "../unix/cmath.rs"]
-pub mod cmath;
 pub mod env;
 pub mod fd;
 pub mod fs;
diff --git a/library/std/src/sys/pal/unsupported/mod.rs b/library/std/src/sys/pal/unsupported/mod.rs
index 6254c67a2a3..b56ded8579c 100644
--- a/library/std/src/sys/pal/unsupported/mod.rs
+++ b/library/std/src/sys/pal/unsupported/mod.rs
@@ -2,8 +2,6 @@
 
 pub mod alloc;
 pub mod args;
-#[path = "../unix/cmath.rs"]
-pub mod cmath;
 pub mod env;
 pub mod fs;
 pub mod io;
diff --git a/library/std/src/sys/pal/wasi/mod.rs b/library/std/src/sys/pal/wasi/mod.rs
index c1fc053bf04..4ffc8ecdd67 100644
--- a/library/std/src/sys/pal/wasi/mod.rs
+++ b/library/std/src/sys/pal/wasi/mod.rs
@@ -20,8 +20,6 @@ use crate::mem;
 #[path = "../unix/alloc.rs"]
 pub mod alloc;
 pub mod args;
-#[path = "../unix/cmath.rs"]
-pub mod cmath;
 pub mod env;
 pub mod fd;
 pub mod fs;
diff --git a/library/std/src/sys/pal/wasm/mod.rs b/library/std/src/sys/pal/wasm/mod.rs
index d2181565887..76306b618d8 100644
--- a/library/std/src/sys/pal/wasm/mod.rs
+++ b/library/std/src/sys/pal/wasm/mod.rs
@@ -19,8 +19,6 @@
 pub mod alloc;
 #[path = "../unsupported/args.rs"]
 pub mod args;
-#[path = "../unix/cmath.rs"]
-pub mod cmath;
 pub mod env;
 #[path = "../unsupported/fs.rs"]
 pub mod fs;
diff --git a/library/std/src/sys/pal/windows/mod.rs b/library/std/src/sys/pal/windows/mod.rs
index d097a7b8bb2..364521dba40 100644
--- a/library/std/src/sys/pal/windows/mod.rs
+++ b/library/std/src/sys/pal/windows/mod.rs
@@ -15,7 +15,6 @@ pub mod compat;
 pub mod alloc;
 pub mod args;
 pub mod c;
-pub mod cmath;
 pub mod env;
 pub mod fs;
 pub mod handle;
diff --git a/library/std/src/sys/pal/xous/mod.rs b/library/std/src/sys/pal/xous/mod.rs
index 230067907c8..fba5e273bab 100644
--- a/library/std/src/sys/pal/xous/mod.rs
+++ b/library/std/src/sys/pal/xous/mod.rs
@@ -3,8 +3,6 @@
 pub mod alloc;
 #[path = "../unsupported/args.rs"]
 pub mod args;
-#[path = "../unix/cmath.rs"]
-pub mod cmath;
 #[path = "../unsupported/env.rs"]
 pub mod env;
 #[path = "../unsupported/fs.rs"]