diff --git a/compatibility-tests/provider-api/src/lib.rs b/compatibility-tests/provider-api/src/lib.rs index 9fa4568..116e49c 100644 --- a/compatibility-tests/provider-api/src/lib.rs +++ b/compatibility-tests/provider-api/src/lib.rs @@ -1,5 +1,5 @@ #![cfg(test)] -#![feature(error_generic_member_access, error_in_core)] +#![feature(error_generic_member_access)] use snafu::{prelude::*, Backtrace, IntoError}; diff --git a/src/lib.rs b/src/lib.rs index e20c23c..dc87cb9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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( diff --git a/tests/location.rs b/tests/location.rs index 72c77ba..7301e95 100644 --- a/tests/location.rs +++ b/tests/location.rs @@ -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!(); @@ -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. }