diff --git a/libs/Patches.md b/libs/Patches.md index c6ef7d96..7360d803 100644 --- a/libs/Patches.md +++ b/libs/Patches.md @@ -255,6 +255,12 @@ into the main commit for that patch, and then the *Update* line can be removed. slightly such that we build a `&mut [u8]` slice and then cast it to a `*mut u8`, thereby avoiding the need for `u32` altogether. +* Return dummy location in `Location::caller` (last applied: January 22, 2026) + + `crucible-mir` does not currently support the `intrinsics::caller_location()` + intrinsic. To prevent this function from throwing translation errors, we have + it return a constant dummy location. + # Notes This section contains more detailed notes about why certain patches are written diff --git a/libs/core/src/panic/location.rs b/libs/core/src/panic/location.rs index 7a68d393..90bb22f6 100644 --- a/libs/core/src/panic/location.rs +++ b/libs/core/src/panic/location.rs @@ -144,7 +144,13 @@ impl<'a> Location<'a> { #[track_caller] #[inline] pub const fn caller() -> &'static Location<'static> { - crate::intrinsics::caller_location() + static DUMMY_LOCATION: Location<'static> = Location { + filename: NonNull::from_ref("dummy.rs"), + line: 0, + col: 0, + _filename: PhantomData, + }; + &DUMMY_LOCATION } /// Returns the name of the source file from which the panic originated.