Open Pratyush opened 4 years ago
Once 1.46 becomes stable, we should use the #[track_caller] feature to make all errors in this crate more informative following the idea outlined in this playground.
#[track_caller]
For example, this is how one could modify SynthesisError:
SynthesisError
enum ErrorKind { AssignmentMissing, ... } pub struct SynthesisError { pub location: &'static Location<'static>, pub error: ErrorKind, } impl From<ErrorKind> from SynthesisError { #[track_caller] from(error: ErrorKind>) -> Self { let location = caller(); Self { location, error } } }
This means that we can now track where an error originates, instead of having it show up only when we unwrap().
unwrap()
Once 1.46 becomes stable, we should use the
#[track_caller]
feature to make all errors in this crate more informative following the idea outlined in this playground.For example, this is how one could modify
SynthesisError
:This means that we can now track where an error originates, instead of having it show up only when we
unwrap()
.