mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
debug_checked_unwrap
should track its caller (#6452)
# Objective When an error causes `debug_checked_unreachable` to be called, the panic message unhelpfully points to the function definition instead of the place that caused the error. ## Solution Add the `#[track_caller]` attribute in debug mode.
This commit is contained in:
parent
96c9c60f80
commit
0e41b79a35
1 changed files with 1 additions and 0 deletions
|
@ -32,6 +32,7 @@ impl<T> DebugCheckedUnwrap for Option<T> {
|
|||
type Item = T;
|
||||
|
||||
#[inline(always)]
|
||||
#[track_caller]
|
||||
unsafe fn debug_checked_unwrap(self) -> Self::Item {
|
||||
if let Some(inner) = self {
|
||||
inner
|
||||
|
|
Loading…
Reference in a new issue