diff options
| author | bors <bors@rust-lang.org> | 2024-05-31 12:18:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-05-31 12:18:57 +0000 |
| commit | 2a2c29aafa50bf6fe53d66b32070eba59f860ac3 (patch) | |
| tree | 278b17527f858913de99475f1d9ecdc41d297f89 /tests/assembly/wasm_exceptions.rs | |
| parent | 99cb42c29641aee2cce6521e07960d4de93205c8 (diff) | |
| parent | 0ea498aa9fc7ddf696d53fe961d30e63e4d38438 (diff) | |
| download | rust-2a2c29aafa50bf6fe53d66b32070eba59f860ac3.tar.gz rust-2a2c29aafa50bf6fe53d66b32070eba59f860ac3.zip | |
Auto merge of #125759 - nnethercote:format-some-tests, r=GuillaumeGomez
Format some tests There are more directories under `tests/` still to do, but this is enough for one PR. r? `@GuillaumeGomez`
Diffstat (limited to 'tests/assembly/wasm_exceptions.rs')
| -rw-r--r-- | tests/assembly/wasm_exceptions.rs | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/tests/assembly/wasm_exceptions.rs b/tests/assembly/wasm_exceptions.rs index 3d3b13ff32b..7bdf7f1287c 100644 --- a/tests/assembly/wasm_exceptions.rs +++ b/tests/assembly/wasm_exceptions.rs @@ -8,7 +8,7 @@ #![feature(core_intrinsics)] #![feature(rustc_attrs)] -extern { +extern "C" { fn may_panic(); #[rustc_nounwind] @@ -19,7 +19,9 @@ struct LogOnDrop; impl Drop for LogOnDrop { fn drop(&mut self) { - unsafe { log_number(0); } + unsafe { + log_number(0); + } } } @@ -27,7 +29,9 @@ impl Drop for LogOnDrop { #[no_mangle] pub fn test_cleanup() { let _log_on_drop = LogOnDrop; - unsafe { may_panic(); } + unsafe { + may_panic(); + } // CHECK-NOT: call // CHECK: try @@ -41,12 +45,16 @@ pub fn test_cleanup() { #[no_mangle] pub fn test_rtry() { unsafe { - core::intrinsics::catch_unwind(|_| { - may_panic(); - }, core::ptr::null_mut(), |data, exception| { - log_number(data as usize); - log_number(exception as usize); - }); + core::intrinsics::catch_unwind( + |_| { + may_panic(); + }, + core::ptr::null_mut(), + |data, exception| { + log_number(data as usize); + log_number(exception as usize); + }, + ); } // CHECK-NOT: call |
