From 2a58f55943451528777d1978217f8104fe20c57d Mon Sep 17 00:00:00 2001 From: Michael Pfaff Date: Mon, 23 Jan 2023 19:06:23 -0500 Subject: [PATCH] Add caller location to context --- src/how.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/how.rs b/src/how.rs index 14108ec..747872f 100644 --- a/src/how.rs +++ b/src/how.rs @@ -18,11 +18,13 @@ struct HowInner { impl How { #[must_use] #[inline(never)] + #[track_caller] pub fn new(context: impl IntoContext) -> Self { Self(Box::new(HowInner { classified: false, context: { let mut vec = Vec::with_capacity(4); + vec.push(format!("At {}", std::panic::Location::caller()).into_context()); vec.push(context.into_context()); vec },