forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#125146 - Oneirical:panic-impl, r=jieyouxu Migrate `run-make/panic-impl-transitive` to `rmake` Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). The test itself is quite simple, but the "handle panics by entering infinite loop" part is strange.
- Loading branch information
Showing
3 changed files
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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(); | ||
} |