Skip to content

Commit

Permalink
Move comment for Windows-only constant into the match arm section
Browse files Browse the repository at this point in the history
  • Loading branch information
c6c7 committed Jul 11, 2024
1 parent 3bd708e commit 70ebedb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions library/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#![feature(process_exitcode_internals)]
#![feature(panic_can_unwind)]
#![feature(test)]
#![feature(inline_const_pat)]
#![allow(internal_features)]

// Public reexports
Expand Down
9 changes: 3 additions & 6 deletions library/test/src/test_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ pub use self::TestResult::*;
// it means.
pub const TR_OK: i32 = 50;

// On Windows we use __fastfail to abort, which is documented to use this
// exception code.
#[cfg(windows)]
const STATUS_ABORTED: i32 = 0xC0000409u32 as i32;

#[derive(Debug, Clone, PartialEq)]
pub enum TestResult {
TrOk,
Expand Down Expand Up @@ -95,8 +90,10 @@ pub fn get_result_from_exit_code(
) -> TestResult {
let result = match status.code() {
Some(TR_OK) => TestResult::TrOk,
// On Windows we use __fastfail to abort, which is documented to use this
// exception code.
#[cfg(windows)]
Some(STATUS_ABORTED) => TestResult::TrFailed,
Some(const {0xC0000409u32 as i32}) => TestResult::TrFailed,
#[cfg(unix)]
None => match status.signal() {
Some(libc::SIGABRT) => TestResult::TrFailed,
Expand Down

0 comments on commit 70ebedb

Please sign in to comment.