Skip to content

Commit

Permalink
userlib: fail if no-panic and panic-messages are both set
Browse files Browse the repository at this point in the history
  • Loading branch information
cbiffle committed Apr 3, 2024
1 parent 1a72038 commit a11ea95
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sys/userlib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,15 @@ pub unsafe extern "C" fn _start() -> ! {
}
}

// Make the no-panic and panic-messages features mutually exclusive.
#[cfg(all(feature = "no-panic", feature = "panic-messages"))]
compile_error!(
"Both the userlib/panic-messages and userlib/no-panic feature flags \
are set! This doesn't make a lot of sense and is probably not what \
you wanted. (If you have a use case for this combination, update \
this check in userlib.)"
);

/// Panic handler for user tasks with the `panic-messages` feature enabled. This
/// handler will try its best to generate a panic message, up to a maximum
/// buffer size (configured below).
Expand Down

0 comments on commit a11ea95

Please sign in to comment.