Add caller location to context

This commit is contained in:
Michael Pfaff 2023-01-23 19:06:23 -05:00
parent bbc7df28d8
commit 2a58f55943
Signed by: michael
GPG Key ID: CF402C4A012AA9D4
1 changed files with 2 additions and 0 deletions

View File

@ -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
},