Closed VorpalBlade closed 1 month ago
I'm not sure if there are any tests that also need to be backported or not.
LGTM!
Did you intend to fix the Debug impl for Value as well to not return fmt::Error
in case the debug impl errors?
Did you intend to fix the Debug impl for Value as well to not return
fmt::Error
in case the debug impl errors?
The fix I did seems to work for my use case (no more panics), but it can still return error indeed. I'm not sure under what conditions that can happen though. But since posting this PR I did manage to hit that path again:
let cmd = process::Command::new("ls");
cmd.arg("-l");
let child = cmd.spawn();
dbg(cmd);
(This fails because cmd
is apparently moved).
So perhaps we should also add something like the <object at address>
format for the error case one level up?
With the latest change we now get debug prints like: <unknown object at 0x7ffd3816a388: Cannot read, value is moved>
, which seems maximally informative.
That's great! I think there's still the is_err thing in the Debug impl (can't check right now) which we should probably get rid off?
Regardless I'll merge this when I'm home. Thanks!
That's great! I think there's still the is_err thing in the Debug impl (can't check right now) which we should probably get rid off?
I must have missed this, not sure what is left at this point?
You're right. Thank you!
Two commits are needed to fix this on 0.13:
Result:Err
). This is a cherry pick from mainValue::string_debug_with
. This is manual backport of the way the code is now done in main and fixes the observed crash.(fixes #747)