Closed nickjknight closed 1 year ago
I tried fixing this, but it seems this might actually originate in proc-macro-error-attr (found via -Z macro-backtrace), so this might not be your problem. If you can think of a way to make this work, that'd be nice so I'm going to leave this open for now.
With reference to serde, it seems that the Result type is used this way within crate.
Maybe other types in std::prelude are likely to have conflicts.
I don't know if there is enough need to support this.
Once closed unless I find other user for this issue.
If a pub struct Ok(string) is defined in the same file as deriving Validate on a struct, the derivation will fail to compile due to attempting to return the new Ok struct instead of the std::result::Result::Ok. The same issue is true with Err().
Suggested fix would be to fully qualify uses of Ok and Err wherever needed to fix this (in the impl definition?).
Here's an example of code that fails to compile with this issue (same happens if "Ok" is "Err"):