rewrite error-found-staticlib-instead-crate to rmake

This commit is contained in:
Oneirical 2024-06-14 15:50:33 -04:00
parent f8e5660532
commit e9ff47ff40
3 changed files with 11 additions and 6 deletions

View File

@ -38,7 +38,6 @@ run-make/emit-shared-files/Makefile
run-make/emit-stack-sizes/Makefile
run-make/emit-to-stdout/Makefile
run-make/env-dep-info/Makefile
run-make/error-found-staticlib-instead-crate/Makefile
run-make/error-writing-dependencies/Makefile
run-make/export-executable-symbols/Makefile
run-make/extern-diff-internal-name/Makefile

View File

@ -1,5 +0,0 @@
include ../tools.mk
all:
$(RUSTC) foo.rs --crate-type staticlib
$(RUSTC) bar.rs 2>&1 | $(CGREP) "found staticlib"

View File

@ -0,0 +1,11 @@
// When rustc is looking for a crate but is given a staticlib instead,
// the error message should be helpful and indicate precisely the cause
// of the compilation failure.
// See https://github.com/rust-lang/rust/pull/21978
use run_make_support::rustc;
fn main() {
rustc().input("foo.rs").crate_type("staticlib").run();
rustc().input("bar.rs").run_fail().assert_stderr_contains("found staticlib");
}