Closed defiori closed 3 years ago
This causes a stack overflow:
println!("{}", shared_memory::ShmemError::MapOpenFailed(0));
Running cargo expand on the quick_error! macro for ShmemError shows this
cargo expand
quick_error!
ShmemError
ShmemError::MapOpenFailed(ref err) => { let display_fn = |x: &ShmemError, f: &mut ::std::fmt::Formatter| { f.write_fmt(::core::fmt::Arguments::new_v1( &["", " : os error "], &match (&x, &err) { (arg0, arg1) => [ ::core::fmt::ArgumentV1::new(arg0, ::core::fmt::Display::fmt), ::core::fmt::ArgumentV1::new(arg1, ::core::fmt::Display::fmt), ], }, )) }; display_fn(self, fmt) }
which seems to contain an infinite recursion, the Display impl for ShmemError calls itself.
Display
Thanks for reporting this, definitely weird...
I see that quick_error had a new major release, maybe I will try switching to that or will just implement the errors manually.
This causes a stack overflow:
Running
cargo expand
on thequick_error!
macro forShmemError
shows thiswhich seems to contain an infinite recursion, the
Display
impl forShmemError
calls itself.