-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Description
When using the Ipld::Link type, it should not be possible to accidentally deserialize it into bytes. The ipld_deserialize_link_not_as_bytes test is there in order to make sure it hold up.
With recent Rust versions, this behaviour changes. To reproduce the issue:
$ cargo +1.72.0 test --features serde-codec --test serde_deserialize ipld_deserialize_link_not_as_bytes
Finished test [unoptimized + debuginfo] target(s) in 0.19s
Running tests/serde_deserialize.rs (/home/vmx/src/pl/rust/libipld/target/debug/deps/serde_deserialize-08fc1a5973f45cb0)
running 1 test
test ipld_deserialize_link_not_as_bytes - should panic ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out; finished in 0.00spasses the tests. But Rust 1.73.0 does not:
$ cargo +1.73.0 test --features serde-codec --test serde_deserialize ipld_deserialize_link_not_as_bytes
Finished test [unoptimized + debuginfo] target(s) in 0.17s
Running tests/serde_deserialize.rs (/home/vmx/src/pl/rust/libipld/target/debug/deps/serde_deserialize-3f5dc1e4175d950e)
running 1 test
test ipld_deserialize_link_not_as_bytes - should panic ... FAILED
failures:
---- ipld_deserialize_link_not_as_bytes stdout ----
thread 'ipld_deserialize_link_not_as_bytes' panicked at core/tests/serde_deserialize.rs:150:5:
assertion `left == right` failed
left: [1, 85, 18, 32, 159, 228, 204, 198, 222, 22, 114, 79, 58, 48, 199, 232, 242, 84, 243, 198, 71, 25, 134, 172, 177, 248, 216, 207, 142, 150, 206, 42, 215, 219, 231, 251]
right: bafkreie74tgmnxqwojhtumgh5dzfj46gi4mynlfr7dmm7duwzyvnpw7h7m
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: panic did not contain expected string
panic message: `"assertion `left == right` failed\n left: [1, 85, 18, 32, 159, 228, 204, 198, 222, 22, 114, 79, 58, 48, 199, 232, 242, 84, 243, 198, 71, 25, 134, 172, 177, 248, 216, 207, 142, 150, 206, 42, 215, 219, 231, 251]\n right: bafkreie74tgmnxqwojhtumgh5dzfj46gi4mynlfr7dmm7duwzyvnpw7h7m"`,
expected substring: `"assertion failed"`
failures:
ipld_deserialize_link_not_as_bytes
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 13 filtered out; finished in 0.00s
error: test failed, to rerun pass `--test serde_deserialize`Metadata
Metadata
Assignees
Labels
No labels