about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMiguel Ojeda <ojeda@kernel.org>2021-10-14 20:47:14 +0200
committerMiguel Ojeda <ojeda@kernel.org>2022-08-26 16:44:32 +0200
commit614c2e404a2eae63c2f392fd90e98960b6ec59bc (patch)
tree598167050ba4ed6637c8290c3122c2ec4f3f7109 /src
parent8a13871b69924b74cfa1d737f2894068b37ea7ea (diff)
downloadrust-614c2e404a2eae63c2f392fd90e98960b6ec59bc.tar.gz
rust-614c2e404a2eae63c2f392fd90e98960b6ec59bc.zip
`alloc`: add unstable cfg features `no_rc` and `no_sync`
In Rust for Linux we are using these to make `alloc` a bit
more modular.

A `run-make-fulldeps` test is added for each of them, so that
enabling each of them independently is kept in a compilable state.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/lib.rs2
-rw-r--r--src/test/run-make-fulldeps/alloc-no-rc/Makefile4
-rw-r--r--src/test/run-make-fulldeps/alloc-no-sync/Makefile4
3 files changed, 10 insertions, 0 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index dcfa92d1004..944c4fa811a 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -197,6 +197,8 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &'static str, Option<&[&'static str]>)]
     (Some(Mode::Std), "stdarch_intel_sde", None),
     (Some(Mode::Std), "no_fp_fmt_parse", None),
     (Some(Mode::Std), "no_global_oom_handling", None),
+    (Some(Mode::Std), "no_rc", None),
+    (Some(Mode::Std), "no_sync", None),
     (Some(Mode::Std), "freebsd12", None),
     (Some(Mode::Std), "backtrace_in_libstd", None),
     /* Extra values not defined in the built-in targets yet, but used in std */
diff --git a/src/test/run-make-fulldeps/alloc-no-rc/Makefile b/src/test/run-make-fulldeps/alloc-no-rc/Makefile
new file mode 100644
index 00000000000..5f7ae70fa02
--- /dev/null
+++ b/src/test/run-make-fulldeps/alloc-no-rc/Makefile
@@ -0,0 +1,4 @@
+include ../tools.mk
+
+all:
+	$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../../library/alloc/src/lib.rs --cfg no_rc
diff --git a/src/test/run-make-fulldeps/alloc-no-sync/Makefile b/src/test/run-make-fulldeps/alloc-no-sync/Makefile
new file mode 100644
index 00000000000..6a258a2ddfd
--- /dev/null
+++ b/src/test/run-make-fulldeps/alloc-no-sync/Makefile
@@ -0,0 +1,4 @@
+include ../tools.mk
+
+all:
+	$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../../library/alloc/src/lib.rs --cfg no_sync