Skip to content

Commit

Permalink
Merge pull request #459 from shepmaster/maint
Browse files Browse the repository at this point in the history
Maintenance
  • Loading branch information
shepmaster authored Jul 8, 2024
2 parents 59be37d + e36f4d8 commit 1b559a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compatibility-tests/provider-api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(test)]
#![feature(error_generic_member_access, error_in_core)]
#![feature(error_generic_member_access)]

use snafu::{prelude::*, Backtrace, IntoError};

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(missing_docs)]
#![allow(stable_features)]
#![cfg_attr(not(any(feature = "std", test)), no_std)]
#![cfg_attr(feature = "unstable-core-error", feature(error_in_core))]
#![cfg_attr(
Expand Down
16 changes: 12 additions & 4 deletions tests/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ mod track_caller {
);
}

#[test]
fn track_caller_is_applied_without_context() {
let base_line = line!();
let wrap_no_context: WrapNoContext = InnerSnafu.build().into();
assert_eq!(
wrap_no_context.location.line,
base_line + 1,
"Actual location: {}",
wrap_no_context.location,
);
}

#[test]
fn track_caller_is_applied_on_result_whatever_context() {
let base_line = line!();
Expand Down Expand Up @@ -226,8 +238,4 @@ mod track_caller {
whatever.location,
);
}

// `track_caller` not supported on the `Try` trait, so we have no
// useful location for `context(false)` errors. Check back in the
// future to see if there's a fix.
}

0 comments on commit 1b559a5

Please sign in to comment.