Having a field of type Backtrace causes #[derive(Fail)] to fail
dflemstr opened this issue · comments
Test case to reproduce:
#[derive(Debug)]
struct Backtrace;
#[derive(Debug, Fail)]
#[fail(display = "error")]
struct Error {
backtrace: Backtrace,
}
I suppose this is a common case of unhygienic procedural macros :)
The derive assumes a backtrace
field to hold a failure::Backtrace
.
The only sees tokens, so it can't check that the type of the field is something other than that.
I reckon there could be something like a #[fail(ignore)]
attribute to enable this.