as a result, in the console output, there is a partial stack trace (which my IDE interprets and makes the file names clickable & blue); as a result, it takes me a while to go from
"something went wrong, I got a stack trace" to "oh, I'm supposed to get a stack trace, this is should_panic"
Question: is there some config flag which tells should_panic to also surpress the stack trace output?
254 | std::panic::set_hook(Box::new(drop));
| ^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected type `FnOnce<(&PanicInfo<'_>,)>`
found type `FnOnce<(&PanicInfo<'_>,)>`
Especially weird as the two types, as far as I can tell, as identical.
Ah, it's because Rust doesn't currently have the ability to convert a function generic over a type to a function generic over a lifetime: drop implements for<T> Fn(T), but Rust doesn't see that as a superset of for<'a, 'b> Fn(&'a PanicInfo<'b>), even though it in theory is. So what Rust is doing is instantiating a drop::<&'1 PanicInfo<'2>> where '1 and '2 are some arbitrarily chosen concrete lifetimes, but that doesn't compile because set_hook requires the function to accept a generic lifetime.