mirror of
https://github.com/dtolnay/thiserror.git
synced 2025-04-05 13:57:38 +03:00
39 lines
756 B
Rust
39 lines
756 B
Rust
#![cfg(thiserror_nightly_testing)]
|
|
#![feature(backtrace)]
|
|
|
|
use std::backtrace::Backtrace;
|
|
use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
#[error("...")]
|
|
pub struct OptSourceNoBacktraceStruct {
|
|
#[source]
|
|
source: Option<anyhow::Error>,
|
|
}
|
|
|
|
#[derive(Error, Debug)]
|
|
#[error("...")]
|
|
pub struct OptSourceAlwaysBacktraceStruct {
|
|
#[source]
|
|
source: Option<anyhow::Error>,
|
|
backtrace: Backtrace,
|
|
}
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum OptSourceNoBacktraceEnum {
|
|
#[error("...")]
|
|
Test {
|
|
#[source]
|
|
source: Option<anyhow::Error>,
|
|
},
|
|
}
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum OptSourceAlwaysBacktraceEnum {
|
|
#[error("...")]
|
|
Test {
|
|
#[source]
|
|
source: Option<anyhow::Error>,
|
|
backtrace: Backtrace,
|
|
},
|
|
}
|