Rewrite core-no-oom-handling
as rmake.rs
This commit is contained in:
parent
5d328a1f62
commit
c24d1c7ff8
4 changed files with 24 additions and 8 deletions
|
@ -156,13 +156,20 @@ impl Rustc {
|
|||
self
|
||||
}
|
||||
|
||||
/// Add a directory to the library search path. Equivalent to `-L`` in rustc.
|
||||
/// Add a directory to the library search path. Equivalent to `-L` in rustc.
|
||||
pub fn library_search_path<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
|
||||
self.cmd.arg("-L");
|
||||
self.cmd.arg(path.as_ref());
|
||||
self
|
||||
}
|
||||
|
||||
/// Override the system root. Equivalent to `--sysroot` in rustc.
|
||||
pub fn sysroot<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
|
||||
self.cmd.arg("--sysroot");
|
||||
self.cmd.arg(path.as_ref());
|
||||
self
|
||||
}
|
||||
|
||||
/// Specify the edition year.
|
||||
pub fn edition(&mut self, edition: &str) -> &mut Self {
|
||||
self.cmd.arg("--edition");
|
||||
|
|
|
@ -25,7 +25,6 @@ run-make/compiler-rt-works-on-mingw/Makefile
|
|||
run-make/compressed-debuginfo/Makefile
|
||||
run-make/const-prop-lint/Makefile
|
||||
run-make/const_fn_mir/Makefile
|
||||
run-make/core-no-oom-handling/Makefile
|
||||
run-make/crate-data-smoke/Makefile
|
||||
run-make/crate-hash-rustc-version/Makefile
|
||||
run-make/crate-name-priority/Makefile
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
include ../tools.mk
|
||||
|
||||
FAKEROOT=$(TMPDIR)/fakeroot
|
||||
|
||||
all:
|
||||
$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../library/core/src/lib.rs --sysroot=$(FAKEROOT) --cfg no_global_oom_handling
|
16
tests/run-make/core-no-oom-handling/rmake.rs
Normal file
16
tests/run-make/core-no-oom-handling/rmake.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
// This test checks that the core library can still compile correctly
|
||||
// when the no_global_oom_handling feature is turned on.
|
||||
// See https://github.com/rust-lang/rust/pull/110649
|
||||
|
||||
use run_make_support::{rustc, tmp_dir};
|
||||
|
||||
fn main() {
|
||||
rustc()
|
||||
.edition("2021")
|
||||
.arg("-Dwarnings")
|
||||
.crate_type("rlib")
|
||||
.input("../../../library/core/src/lib.rs")
|
||||
.sysroot(tmp_dir().join("fakeroot"));
|
||||
.cfg("no_global_oom_handling")
|
||||
.run();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue