Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sidit77
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
sidit77
3y ago
You can just pass the location up the stack alongside the type erased error. #[derive(Debug)] pub struct LocatedError { inner: Box<dyn Error + 'static>, location: &'static Location<'static>
2.
▲
by
sidit77
3y ago
Any reason why you implemented your own proc macro instead of just using std::panic::Location::caller()? Right now I don't see the advantage of this crate.
3.
▲
by
sidit77
5y ago
When implementing Display you only get access to an immutable reference to self, so the only possibly side effects are writes to global variables.