Skip to content

Commit

Permalink
rewrite panic-impl-transitive
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed May 15, 2024
1 parent 3cb0030 commit cae17ff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ run-make/output-with-hyphens/Makefile
run-make/override-aliased-flags/Makefile
run-make/overwrite-input/Makefile
run-make/panic-abort-eh_frame/Makefile
run-make/panic-impl-transitive/Makefile
run-make/pass-linker-flags-flavor/Makefile
run-make/pass-linker-flags-from-dep/Makefile
run-make/pass-linker-flags/Makefile
Expand Down
7 changes: 0 additions & 7 deletions tests/run-make/panic-impl-transitive/Makefile

This file was deleted.

14 changes: 14 additions & 0 deletions tests/run-make/panic-impl-transitive/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// In Rust programs where the standard library is unavailable (#![no_std]), we may be interested
// in customizing how panics are handled. Here, the provider specifies that panics should be handled
// by entering an infinite loop. This test checks that this panic implementation can be transitively
// provided by an external crate.
// --emit=llvm-ir is used to avoid running the linker, as linking will fail due to the lack of main
// function in the crate.
// See https://github.com/rust-lang/rust/pull/50338

use run_make_support::{rustc, tmp_dir};

fn main() {
rustc().input("panic-impl-provider.rs").run();
rustc().input("panic-impl-consumer.rs").panic("abort").emit("llvm-ir").library_search_path(tmp_dir()).run();
}

0 comments on commit cae17ff

Please sign in to comment.