Skip to content

Commit c24d1c7

Browse files
committed
Rewrite core-no-oom-handling as rmake.rs
1 parent 5d328a1 commit c24d1c7

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

src/tools/run-make-support/src/rustc.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,20 @@ impl Rustc {
156156
self
157157
}
158158

159-
/// Add a directory to the library search path. Equivalent to `-L`` in rustc.
159+
/// Add a directory to the library search path. Equivalent to `-L` in rustc.
160160
pub fn library_search_path<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
161161
self.cmd.arg("-L");
162162
self.cmd.arg(path.as_ref());
163163
self
164164
}
165165

166+
/// Override the system root. Equivalent to `--sysroot` in rustc.
167+
pub fn sysroot<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
168+
self.cmd.arg("--sysroot");
169+
self.cmd.arg(path.as_ref());
170+
self
171+
}
172+
166173
/// Specify the edition year.
167174
pub fn edition(&mut self, edition: &str) -> &mut Self {
168175
self.cmd.arg("--edition");

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ run-make/compiler-rt-works-on-mingw/Makefile
2525
run-make/compressed-debuginfo/Makefile
2626
run-make/const-prop-lint/Makefile
2727
run-make/const_fn_mir/Makefile
28-
run-make/core-no-oom-handling/Makefile
2928
run-make/crate-data-smoke/Makefile
3029
run-make/crate-hash-rustc-version/Makefile
3130
run-make/crate-name-priority/Makefile

tests/run-make/core-no-oom-handling/Makefile

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This test checks that the core library can still compile correctly
2+
// when the no_global_oom_handling feature is turned on.
3+
// See https://github.com/rust-lang/rust/pull/110649
4+
5+
use run_make_support::{rustc, tmp_dir};
6+
7+
fn main() {
8+
rustc()
9+
.edition("2021")
10+
.arg("-Dwarnings")
11+
.crate_type("rlib")
12+
.input("../../../library/core/src/lib.rs")
13+
.sysroot(tmp_dir().join("fakeroot"));
14+
.cfg("no_global_oom_handling")
15+
.run();
16+
}

0 commit comments

Comments
 (0)