From 11eded39c55c7b9baa23a1d4a6d2c31de97c8416 Mon Sep 17 00:00:00 2001 From: Oneirical Date: Mon, 17 Jun 2024 16:11:14 -0400 Subject: [PATCH] rewrite allocator-shim-circular-deps to ui test --- .../tidy/src/allowed_run_make_makefiles.txt | 1 - src/tools/tidy/src/ui_tests.rs | 2 +- .../allocator-shim-circular-deps/Makefile | 12 ----------- .../allocator-shim-circular-deps/main.rs | 5 ----- .../ui/issues/allocator-shim-circular-deps.rs | 20 +++++++++++++++++++ .../issues/auxiliary}/my_lib.rs | 0 6 files changed, 21 insertions(+), 19 deletions(-) delete mode 100644 tests/run-make/allocator-shim-circular-deps/Makefile delete mode 100644 tests/run-make/allocator-shim-circular-deps/main.rs create mode 100644 tests/ui/issues/allocator-shim-circular-deps.rs rename tests/{run-make/allocator-shim-circular-deps => ui/issues/auxiliary}/my_lib.rs (100%) diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index 8f1d36bb26d82..39a567b13a4fe 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -1,4 +1,3 @@ -run-make/allocator-shim-circular-deps/Makefile run-make/archive-duplicate-names/Makefile run-make/atomic-lock-free/Makefile run-make/branch-protection-check-IBT/Makefile diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index f2eeda339d80e..8cb34ae6811b8 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -15,7 +15,7 @@ use std::path::{Path, PathBuf}; const ENTRY_LIMIT: u32 = 900; // FIXME: The following limits should be reduced eventually. -const ISSUES_ENTRY_LIMIT: u32 = 1672; +const ISSUES_ENTRY_LIMIT: u32 = 1673; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files diff --git a/tests/run-make/allocator-shim-circular-deps/Makefile b/tests/run-make/allocator-shim-circular-deps/Makefile deleted file mode 100644 index f667e2e2ec293..0000000000000 --- a/tests/run-make/allocator-shim-circular-deps/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# This test is designed to intentionally introduce a circular dependency scenario to check that a specific compiler bug doesn't make a resurgence. -# The bug in question arose when at least one crate required a global allocator, and that crate was placed after the one defining it in the linker order. -# The generated symbols.o should not result in any linker errors. -# See https://github.com/rust-lang/rust/issues/112715 - -# ignore-cross-compile -include ../tools.mk - -all: - rm -rf $(TMPDIR) && mkdir $(TMPDIR) - $(RUSTC) my_lib.rs - $(RUSTC) main.rs --test --extern my_lib=$(TMPDIR)/libmy_lib.rlib diff --git a/tests/run-make/allocator-shim-circular-deps/main.rs b/tests/run-make/allocator-shim-circular-deps/main.rs deleted file mode 100644 index e317c657150a8..0000000000000 --- a/tests/run-make/allocator-shim-circular-deps/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![crate_type = "bin"] - -fn main() { - my_lib::do_something(); -} diff --git a/tests/ui/issues/allocator-shim-circular-deps.rs b/tests/ui/issues/allocator-shim-circular-deps.rs new file mode 100644 index 0000000000000..3af20d6b32025 --- /dev/null +++ b/tests/ui/issues/allocator-shim-circular-deps.rs @@ -0,0 +1,20 @@ +// This test is designed to intentionally introduce a circular dependency scenario to check +// that a specific compiler bug doesn't make a resurgence. +// The bug in question arose when at least one crate +// required a global allocator, and that crate was placed after +// the one defining it in the linker order. +// The generated symbols.o should not result in any linker errors. +// See https://github.com/rust-lang/rust/issues/112715 + +//@ ignore-cross-compile +//@ check-pass +//@ compile-flags: --test +//@ aux-build: my_lib.rs + +#[crate_type = "bin"] + +extern crate my_lib; + +fn main() { + my_lib::do_something(); +} diff --git a/tests/run-make/allocator-shim-circular-deps/my_lib.rs b/tests/ui/issues/auxiliary/my_lib.rs similarity index 100% rename from tests/run-make/allocator-shim-circular-deps/my_lib.rs rename to tests/ui/issues/auxiliary/my_lib.rs