[core] fix unreachable bug in storage2::Stash and add regression test (#425)

16 jobs for master in 5 minutes and 16 seconds (queued for 4 seconds)
Status Job ID Name Coverage
  Check
passed #525578
linux-docker
check-std

00:02:02

failed #525579
linux-docker
check-wasm

00:00:12

 
  Workspace
passed #525580
linux-docker
build-std

00:01:59

skipped #525581
linux-docker
build-wasm
passed #525585
linux-docker
clippy-std

00:01:40

skipped #525587
linux-docker
clippy-wasm
passed #525583
linux-docker
codecov

00:03:09

skipped #525589
linux-docker
fmt
failed #525582
linux-docker
test

00:00:12

 
  Examples
failed #525595
linux-docker
examples-clippy-std

00:00:13

skipped #525597
linux-docker
examples-clippy-wasm
skipped #525598
linux-docker
examples-contract-build
skipped #525593
linux-docker
examples-fmt
skipped #525599
linux-docker
examples-generate-metadata
passed #525591
linux-docker
examples-test

00:01:30

 
  Publish
skipped #525600
linux-docker
publish-docs
 
Name Stage Failure
failed
examples-clippy-std Examples
There is NO WARRANTY, to the extent permitted by law.
$ ./scripts/pre_cache.sh
____No need to prepopulate CARGO_TARGET_DIR cache____
$ sccache -s
error: failed to get stats from server
caused by: Failed to send data to or receive data from server
caused by: Failed to read response header
caused by: failed to fill whole buffer
ERROR: Job failed: exit code 1
failed
test Workspace
There is NO WARRANTY, to the extent permitted by law.
$ ./scripts/pre_cache.sh
____No need to prepopulate CARGO_TARGET_DIR cache____
$ sccache -s
error: failed to get stats from server
caused by: Failed to send data to or receive data from server
caused by: Failed to read response header
caused by: failed to fill whole buffer
ERROR: Job failed: exit code 1
failed
check-wasm Check
There is NO WARRANTY, to the extent permitted by law.
$ ./scripts/pre_cache.sh
____No need to prepopulate CARGO_TARGET_DIR cache____
$ sccache -s
error: failed to get stats from server
caused by: Failed to send data to or receive data from server
caused by: Failed to read response header
caused by: failed to fill whole buffer
ERROR: Job failed: exit code 1