Add test that backtrace method exists on nightly

This commit is contained in:
David Tolnay 2019-10-18 10:50:31 -04:00
parent 5ada2978c5
commit 6d0a0196eb
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 14 additions and 0 deletions

View File

@ -14,4 +14,5 @@ default = ["std"]
std = []
[dev-dependencies]
rustversion = "1.0"
thiserror = "1.0"

13
tests/test_backtrace.rs Normal file
View File

@ -0,0 +1,13 @@
#[rustversion::not(nightly)]
#[ignore]
#[test]
fn test_backtrace() {}
#[rustversion::nightly]
#[test]
fn test_backtrace() {
use anyhow::anyhow;
let error = anyhow!("oh no!");
let _ = error.backtrace();
}