html-to-markdown 2.23.4 → 2.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -7
- data/README.md +9 -7
- data/ext/html-to-markdown-rb/native/Cargo.lock +21 -21
- data/ext/html-to-markdown-rb/native/Cargo.toml +1 -3
- data/lib/html_to_markdown/cli_proxy.rb +5 -2
- data/lib/html_to_markdown/version.rb +1 -1
- data/rust-vendor/cc/.cargo-checksum.json +1 -1
- data/rust-vendor/cc/.cargo_vcs_info.json +1 -1
- data/rust-vendor/cc/CHANGELOG.md +7 -0
- data/rust-vendor/cc/Cargo.lock +1 -1
- data/rust-vendor/cc/Cargo.toml +1 -1
- data/rust-vendor/cc/Cargo.toml.orig +1 -1
- data/rust-vendor/cc/src/target/generated.rs +1 -0
- data/rust-vendor/cc/src/target/parser.rs +4 -0
- data/rust-vendor/html-to-markdown-rs/README.md +1 -1
- data/rust-vendor/html-to-markdown-rs/src/convert_api.rs +90 -15
- data/rust-vendor/html-to-markdown-rs/src/converter/block/preformatted.rs +15 -4
- data/rust-vendor/html-to-markdown-rs/src/converter/handlers/graphic.rs +5 -3
- data/rust-vendor/html-to-markdown-rs/src/converter/media/svg.rs +5 -1
- data/rust-vendor/html-to-markdown-rs/src/converter/text/processing.rs +15 -8
- data/rust-vendor/html-to-markdown-rs/src/converter/utility/preprocessing.rs +43 -18
- data/rust-vendor/html-to-markdown-rs/src/lib.rs +6 -6
- data/rust-vendor/html-to-markdown-rs/src/validation.rs +68 -29
- data/rust-vendor/html-to-markdown-rs/tests/issue_190_regressions.rs +121 -0
- data/rust-vendor/html-to-markdown-rs/tests/skip_images_test.rs +21 -0
- data/rust-vendor/proc-macro2/.cargo-checksum.json +1 -1
- data/rust-vendor/proc-macro2/.cargo_vcs_info.json +1 -1
- data/rust-vendor/proc-macro2/Cargo.lock +14 -89
- data/rust-vendor/proc-macro2/Cargo.toml +1 -1
- data/rust-vendor/proc-macro2/Cargo.toml.orig +1 -1
- data/rust-vendor/proc-macro2/src/fallback.rs +37 -23
- data/rust-vendor/proc-macro2/src/lib.rs +1 -1
- data/rust-vendor/quote/.cargo-checksum.json +1 -1
- data/rust-vendor/quote/.cargo_vcs_info.json +1 -1
- data/rust-vendor/quote/.github/workflows/ci.yml +1 -1
- data/rust-vendor/quote/Cargo.lock +17 -17
- data/rust-vendor/quote/Cargo.toml +1 -1
- data/rust-vendor/quote/Cargo.toml.orig +1 -1
- data/rust-vendor/quote/src/format.rs +2 -2
- data/rust-vendor/quote/src/lib.rs +1 -1
- data/rust-vendor/quote/src/runtime.rs +2 -2
- data/rust-vendor/quote/tests/test.rs +6 -0
- data/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr +2 -2
- data/rust-vendor/quote/tests/ui/does-not-have-iter-interpolated.stderr +2 -2
- data/rust-vendor/quote/tests/ui/does-not-have-iter-separated.stderr +2 -2
- data/rust-vendor/quote/tests/ui/does-not-have-iter.stderr +2 -2
- data/rust-vendor/quote/tests/ui/not-repeatable.stderr +8 -8
- data/rust-vendor/siphasher/.cargo-checksum.json +1 -1
- data/rust-vendor/siphasher/.cargo_vcs_info.json +1 -1
- data/rust-vendor/siphasher/.github/workflows/issues.yml +17 -0
- data/rust-vendor/siphasher/COPYING +1 -1
- data/rust-vendor/siphasher/Cargo.lock +89 -0
- data/rust-vendor/siphasher/Cargo.toml +23 -13
- data/rust-vendor/siphasher/Cargo.toml.orig +1 -1
- data/rust-vendor/siphasher/src/common.rs +65 -0
- data/rust-vendor/siphasher/src/lib.rs +1 -1
- data/rust-vendor/siphasher/src/sip.rs +2 -68
- data/rust-vendor/siphasher/src/sip128.rs +15 -74
- data/rust-vendor/siphasher/src/tests.rs +1 -1
- data/rust-vendor/siphasher/src/tests128.rs +1 -1
- data/rust-vendor/uuid/.cargo-checksum.json +1 -1
- data/rust-vendor/uuid/.cargo_vcs_info.json +1 -1
- data/rust-vendor/uuid/Cargo.lock +125 -96
- data/rust-vendor/uuid/Cargo.toml +4 -11
- data/rust-vendor/uuid/Cargo.toml.orig +5 -14
- data/rust-vendor/uuid/README.md +3 -3
- data/rust-vendor/uuid/src/builder.rs +2 -1
- data/rust-vendor/uuid/src/external/serde_support.rs +209 -142
- data/rust-vendor/uuid/src/lib.rs +9 -11
- data/rust-vendor/uuid/src/macros.rs +9 -54
- data/rust-vendor/uuid/src/non_nil.rs +49 -2
- data/rust-vendor/web_atoms/.cargo-checksum.json +1 -1
- data/rust-vendor/web_atoms/.cargo_vcs_info.json +1 -1
- data/rust-vendor/web_atoms/Cargo.lock +1 -1
- data/rust-vendor/web_atoms/Cargo.toml +1 -1
- data/rust-vendor/web_atoms/Cargo.toml.orig +1 -1
- data/rust-vendor/web_atoms/local_names.txt +3 -0
- data/rust-vendor/zerocopy/.cargo-checksum.json +1 -1
- data/rust-vendor/zerocopy/.cargo_vcs_info.json +1 -1
- data/rust-vendor/zerocopy/Cargo.lock +5 -9
- data/rust-vendor/zerocopy/Cargo.toml +10 -18
- data/rust-vendor/zerocopy/Cargo.toml.orig +6 -14
- data/rust-vendor/zerocopy/Cargo.toml.std +58 -0
- data/rust-vendor/zerocopy/agent_docs/ui_tests.md +5 -5
- data/rust-vendor/zerocopy/cargo.sh +1 -1
- data/rust-vendor/zerocopy/ci/check_fmt.sh +1 -1
- data/rust-vendor/zerocopy/ci/check_readme.sh +1 -1
- data/rust-vendor/zerocopy/ci/check_stale_stderr.sh +44 -0
- data/rust-vendor/zerocopy/githooks/pre-push +2 -0
- data/rust-vendor/zerocopy/src/byte_slice.rs +1 -1
- data/rust-vendor/zerocopy/src/byteorder.rs +0 -1
- data/rust-vendor/zerocopy/src/impls.rs +334 -118
- data/rust-vendor/zerocopy/src/layout.rs +9 -0
- data/rust-vendor/zerocopy/src/lib.rs +163 -74
- data/rust-vendor/zerocopy/src/macros.rs +4 -8
- data/rust-vendor/zerocopy/src/pointer/inner.rs +4 -4
- data/rust-vendor/zerocopy/src/pointer/invariant.rs +22 -5
- data/rust-vendor/zerocopy/src/pointer/mod.rs +155 -18
- data/rust-vendor/zerocopy/src/pointer/ptr.rs +133 -182
- data/rust-vendor/zerocopy/src/pointer/transmute.rs +99 -106
- data/rust-vendor/zerocopy/src/ref.rs +4 -4
- data/rust-vendor/zerocopy/src/util/macro_util.rs +73 -127
- data/rust-vendor/zerocopy/src/util/macros.rs +61 -150
- data/rust-vendor/zerocopy/src/wrappers.rs +249 -3
- data/rust-vendor/zerocopy/tests/include.rs +67 -0
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-from-bytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-from-bytes.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-from-zeros.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-from-zeros.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-immutable.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-immutable.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-into-bytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-into-bytes.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-issue-1296.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-issue-1296.stderr +8 -8
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-known-layout.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-known-layout.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-unaligned.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-unaligned.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-msrv/include_value_not_from_bytes.rs +3 -5
- data/rust-vendor/zerocopy/tests/ui-msrv/include_value_not_from_bytes.stderr +10 -10
- data/rust-vendor/zerocopy/tests/ui-msrv/include_value_wrong_size.rs +1 -4
- data/rust-vendor/zerocopy/tests/ui-msrv/include_value_wrong_size.stderr +3 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/invalid-impls/invalid-impls.rs +0 -1
- data/rust-vendor/zerocopy/tests/ui-msrv/invalid-impls/invalid-impls.stderr +35 -35
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-dst-not-frombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-dst-not-frombytes.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-const.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-const.stderr +10 -10
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-a-reference.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-a-reference.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-frombytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-frombytes.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-intobytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-intobytes.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-unsized.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-unsized.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-dst-not-references.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-dst-not-references.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-immutable.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-immutable.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-a-reference.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-a-reference.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-frombytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-frombytes.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-intobytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-intobytes.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-unsized.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-unsized.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ptr-to-usize.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ptr-to-usize.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-mutable.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-mutable.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-a-reference.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-a-reference.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-frombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-frombytes.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-nocell.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-nocell.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-unsized.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-unsized.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-dst-not-references.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-dst-not-references.stderr +8 -8
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-a-reference.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-a-reference.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-intobytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-intobytes.stderr +12 -12
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-nocell.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-nocell.stderr +12 -12
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-unsized.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-unsized.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-decrease.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-decrease.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-increase-allow-shrink.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-increase-allow-shrink.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-increase.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-src-not-intobytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-src-not-intobytes.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-dst-not-tryfrombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-dst-not-tryfrombytes.stderr +12 -12
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-size-decrease.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-size-decrease.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-size-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-size-increase.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-src-not-intobytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-src-not-intobytes.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-alignment-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-alignment-increase.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.stderr +16 -16
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-decrease.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-decrease.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-increase.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-src-not-frombytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-src-not-frombytes.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-src-not-intobytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-src-not-intobytes.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-alignment-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-alignment-increase.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-mutable.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-mutable.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +16 -16
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-decrease.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-decrease.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-increase.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.stderr +8 -8
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-from-bytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-from-bytes.stderr +15 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-from-zeros.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-from-zeros.stderr +12 -12
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-immutable.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-immutable.stderr +13 -13
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-into-bytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-into-bytes.stderr +8 -8
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-issue-1296.stderr +16 -16
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-known-layout.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-known-layout.stderr +8 -8
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.stderr +15 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-unaligned.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-unaligned.stderr +5 -5
- data/rust-vendor/zerocopy/tests/ui-nightly/include_value_not_from_bytes.rs +3 -5
- data/rust-vendor/zerocopy/tests/ui-nightly/include_value_not_from_bytes.stderr +21 -21
- data/rust-vendor/zerocopy/tests/ui-nightly/include_value_wrong_size.rs +1 -4
- data/rust-vendor/zerocopy/tests/ui-nightly/include_value_wrong_size.stderr +8 -8
- data/rust-vendor/zerocopy/tests/ui-nightly/invalid-impls/invalid-impls.rs +0 -1
- data/rust-vendor/zerocopy/tests/ui-nightly/invalid-impls/invalid-impls.stderr +35 -51
- data/rust-vendor/zerocopy/tests/ui-nightly/ptr-is-invariant-over-v.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-dst-not-frombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-dst-not-frombytes.stderr +15 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-const.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-const.stderr +7 -7
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-a-reference.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-a-reference.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-frombytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-frombytes.stderr +12 -12
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-intobytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-intobytes.stderr +5 -5
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-unsized.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-unsized.stderr +3 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-dst-not-references.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-dst-not-references.stderr +3 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-immutable.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-immutable.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-a-reference.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-a-reference.stderr +3 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-frombytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-frombytes.stderr +12 -12
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-intobytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-intobytes.stderr +5 -5
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-unsized.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-unsized.stderr +3 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ptr-to-usize.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ptr-to-usize.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-mutable.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-mutable.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-a-reference.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-a-reference.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-frombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-frombytes.stderr +16 -16
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-nocell.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-nocell.stderr +14 -14
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-unsized.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-unsized.stderr +3 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-dst-not-references.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-dst-not-references.stderr +9 -9
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-a-reference.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-a-reference.stderr +3 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-intobytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-intobytes.stderr +18 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-nocell.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-nocell.stderr +28 -28
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-unsized.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-unsized.stderr +3 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-decrease.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-decrease.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-increase-allow-shrink.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-increase-allow-shrink.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-increase.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-src-not-intobytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-src-not-intobytes.stderr +8 -8
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.stderr +43 -43
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-size-decrease.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-size-decrease.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-size-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-size-increase.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-src-not-intobytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-src-not-intobytes.stderr +8 -8
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-alignment-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-alignment-increase.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.stderr +51 -51
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-decrease.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-decrease.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-increase.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-src-not-frombytes.stderr +29 -29
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-src-not-intobytes.stderr +22 -22
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-alignment-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-alignment-increase.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-mutable.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-mutable.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +56 -56
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-decrease.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-decrease.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-increase.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.stderr +21 -21
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-from-bytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-from-bytes.stderr +15 -15
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-from-zeros.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-from-zeros.stderr +12 -12
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-immutable.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-immutable.stderr +13 -13
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-into-bytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-into-bytes.stderr +8 -8
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-issue-1296.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-issue-1296.stderr +16 -16
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-known-layout.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-known-layout.stderr +8 -8
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-try-from-bytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-try-from-bytes.stderr +15 -15
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-unaligned.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-unaligned.stderr +5 -5
- data/rust-vendor/zerocopy/tests/ui-stable/include_value_not_from_bytes.rs +3 -5
- data/rust-vendor/zerocopy/tests/ui-stable/include_value_not_from_bytes.stderr +21 -21
- data/rust-vendor/zerocopy/tests/ui-stable/include_value_wrong_size.rs +1 -4
- data/rust-vendor/zerocopy/tests/ui-stable/include_value_wrong_size.stderr +8 -8
- data/rust-vendor/zerocopy/tests/ui-stable/invalid-impls/invalid-impls.rs +0 -1
- data/rust-vendor/zerocopy/tests/ui-stable/invalid-impls/invalid-impls.stderr +37 -37
- data/rust-vendor/zerocopy/tests/ui-stable/ptr-is-invariant-over-v.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-dst-not-frombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-dst-not-frombytes.stderr +15 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-const.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-const.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-a-reference.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-a-reference.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-frombytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-frombytes.stderr +11 -11
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-intobytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-intobytes.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-unsized.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-unsized.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-dst-not-references.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-dst-not-references.stderr +3 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-immutable.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-immutable.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-a-reference.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-a-reference.stderr +3 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-frombytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-frombytes.stderr +11 -11
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-intobytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-intobytes.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-unsized.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-unsized.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ptr-to-usize.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ptr-to-usize.stderr +9 -5
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-mutable.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-mutable.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-a-reference.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-a-reference.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-frombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-frombytes.stderr +16 -16
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-nocell.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-nocell.stderr +14 -14
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-unsized.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-unsized.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-dst-not-references.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-dst-not-references.stderr +9 -9
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-a-reference.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-a-reference.stderr +3 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-intobytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-intobytes.stderr +18 -18
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-nocell.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-nocell.stderr +28 -28
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-unsized.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-unsized.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-decrease.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-decrease.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-increase-allow-shrink.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-increase-allow-shrink.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-increase.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-src-not-intobytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-src-not-intobytes.stderr +8 -8
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-dst-not-tryfrombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-dst-not-tryfrombytes.stderr +42 -42
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-size-decrease.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-size-decrease.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-size-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-size-increase.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-src-not-intobytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-src-not-intobytes.stderr +7 -7
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-alignment-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-alignment-increase.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.stderr +49 -49
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-decrease.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-decrease.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-increase.stderr +4 -4
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-src-not-frombytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-src-not-frombytes.stderr +26 -26
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-src-not-intobytes.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-src-not-intobytes.stderr +19 -19
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-alignment-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-alignment-increase.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-mutable.rs +0 -2
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-mutable.stderr +6 -6
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +54 -54
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-decrease.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-decrease.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-increase.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-increase.stderr +2 -2
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.rs +1 -3
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.stderr +19 -19
- data/rust-vendor/zerocopy-derive/.cargo-checksum.json +1 -1
- data/rust-vendor/zerocopy-derive/.cargo_vcs_info.json +1 -1
- data/rust-vendor/zerocopy-derive/Cargo.lock +3 -11
- data/rust-vendor/zerocopy-derive/Cargo.toml +13 -11
- data/rust-vendor/zerocopy-derive/Cargo.toml.orig +7 -10
- data/rust-vendor/zerocopy-derive/src/derive/from_bytes.rs +188 -0
- data/rust-vendor/zerocopy-derive/src/derive/into_bytes.rs +158 -0
- data/rust-vendor/zerocopy-derive/src/derive/known_layout.rs +348 -0
- data/rust-vendor/zerocopy-derive/src/derive/mod.rs +130 -0
- data/rust-vendor/zerocopy-derive/src/derive/try_from_bytes.rs +729 -0
- data/rust-vendor/zerocopy-derive/src/derive/unaligned.rs +78 -0
- data/rust-vendor/zerocopy-derive/src/lib.rs +31 -1893
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/eq.expected.rs +17 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_bytes_enum.expected.rs +64 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_bytes_struct.expected.rs +64 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_bytes_union.expected.rs +144 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/from_zeros.expected.rs +39 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/hash.expected.rs +24 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/immutable.expected.rs +17 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.expected.rs +17 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_struct_basic.expected.rs +25 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_struct_empty.expected.rs +17 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_struct_trailing.expected.rs +25 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_struct_trailing_generic.expected.rs +21 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/known_layout_repr_c_struct.expected.rs +135 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/known_layout_struct.expected.rs +34 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/split_at_repr_c.expected.rs +22 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/split_at_repr_transparent.expected.rs +22 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes.expected.rs +22 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_enum_1.expected.rs +2802 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_enum_2.expected.rs +2802 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_enum_3.expected.rs +2802 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/try_from_bytes_trivial_is_bit_valid_enum.expected.rs +22 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/unaligned.expected.rs +17 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/mod.rs +960 -0
- data/rust-vendor/zerocopy-derive/src/util.rs +757 -0
- data/rust-vendor/zerocopy-derive/tests/deprecated.rs +6 -0
- data/rust-vendor/zerocopy-derive/tests/enum_from_zeros.rs +9 -0
- data/rust-vendor/zerocopy-derive/tests/enum_known_layout.rs +4 -0
- data/rust-vendor/zerocopy-derive/tests/enum_no_cell.rs +4 -0
- data/rust-vendor/zerocopy-derive/tests/enum_to_bytes.rs +14 -0
- data/rust-vendor/zerocopy-derive/tests/enum_try_from_bytes.rs +37 -15
- data/rust-vendor/zerocopy-derive/tests/enum_unaligned.rs +4 -0
- data/rust-vendor/zerocopy-derive/tests/eq.rs +1 -0
- data/rust-vendor/zerocopy-derive/tests/hash.rs +1 -0
- data/rust-vendor/zerocopy-derive/tests/hygiene.rs +3 -1
- data/rust-vendor/zerocopy-derive/tests/include.rs +26 -4
- data/rust-vendor/zerocopy-derive/tests/issue_2117.rs +1 -0
- data/rust-vendor/zerocopy-derive/tests/issue_2835.rs +2 -1
- data/rust-vendor/zerocopy-derive/tests/issue_2880.rs +292 -0
- data/rust-vendor/zerocopy-derive/tests/issue_2915.rs +78 -0
- data/rust-vendor/zerocopy-derive/tests/paths_and_modules.rs +3 -0
- data/rust-vendor/zerocopy-derive/tests/priv_in_pub.rs +2 -0
- data/rust-vendor/zerocopy-derive/tests/struct_from_bytes.rs +6 -0
- data/rust-vendor/zerocopy-derive/tests/struct_from_zeros.rs +6 -0
- data/rust-vendor/zerocopy-derive/tests/struct_known_layout.rs +9 -0
- data/rust-vendor/zerocopy-derive/tests/struct_no_cell.rs +8 -0
- data/rust-vendor/zerocopy-derive/tests/struct_to_bytes.rs +17 -0
- data/rust-vendor/zerocopy-derive/tests/struct_try_from_bytes.rs +29 -65
- data/rust-vendor/zerocopy-derive/tests/struct_unaligned.rs +7 -0
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/derive_transparent.rs +3 -2
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/derive_transparent.stderr +32 -32
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/enum.rs +48 -1
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/enum.stderr +129 -126
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/enum_from_bytes_u8_too_few.rs +2 -1
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/enum_from_bytes_u8_too_few.stderr +6 -6
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/late_compile_pass.rs +9 -2
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/late_compile_pass.stderr +37 -37
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/mid_compile_pass.rs +6 -2
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/mid_compile_pass.stderr +26 -26
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/msrv_specific.rs +3 -2
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/msrv_specific.stderr +7 -7
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/privacy.rs +66 -29
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/privacy.stderr +78 -78
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/struct.rs +34 -2
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/struct.stderr +79 -79
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/union.rs +12 -1
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/union.stderr +29 -29
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/union_into_bytes_cfg/union_into_bytes_cfg.rs +3 -2
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.rs +3 -2
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.stderr +2 -2
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/derive_transparent.rs +3 -2
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/derive_transparent.stderr +57 -57
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum.rs +48 -1
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum.stderr +200 -192
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.rs +2 -1
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.stderr +6 -6
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/late_compile_pass.rs +9 -2
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/late_compile_pass.stderr +105 -105
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/mid_compile_pass.rs +6 -2
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/mid_compile_pass.stderr +29 -29
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/privacy.rs +66 -29
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/privacy.stderr +15 -15
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/struct.rs +34 -2
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/struct.stderr +130 -129
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/union.rs +12 -1
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/union.stderr +42 -42
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/union_into_bytes_cfg/union_into_bytes_cfg.rs +3 -2
- data/rust-vendor/zerocopy-derive/tests/ui-stable/derive_transparent.rs +3 -2
- data/rust-vendor/zerocopy-derive/tests/ui-stable/derive_transparent.stderr +57 -57
- data/rust-vendor/zerocopy-derive/tests/ui-stable/enum.rs +48 -1
- data/rust-vendor/zerocopy-derive/tests/ui-stable/enum.stderr +201 -186
- data/rust-vendor/zerocopy-derive/tests/ui-stable/enum_from_bytes_u8_too_few.rs +2 -1
- data/rust-vendor/zerocopy-derive/tests/ui-stable/enum_from_bytes_u8_too_few.stderr +6 -6
- data/rust-vendor/zerocopy-derive/tests/ui-stable/late_compile_pass.rs +9 -2
- data/rust-vendor/zerocopy-derive/tests/ui-stable/late_compile_pass.stderr +105 -105
- data/rust-vendor/zerocopy-derive/tests/ui-stable/mid_compile_pass.rs +6 -2
- data/rust-vendor/zerocopy-derive/tests/ui-stable/mid_compile_pass.stderr +29 -29
- data/rust-vendor/zerocopy-derive/tests/ui-stable/privacy.rs +66 -29
- data/rust-vendor/zerocopy-derive/tests/ui-stable/privacy.stderr +15 -15
- data/rust-vendor/zerocopy-derive/tests/ui-stable/struct.rs +34 -2
- data/rust-vendor/zerocopy-derive/tests/ui-stable/struct.stderr +158 -129
- data/rust-vendor/zerocopy-derive/tests/ui-stable/union.rs +12 -1
- data/rust-vendor/zerocopy-derive/tests/ui-stable/union.stderr +48 -44
- data/rust-vendor/zerocopy-derive/tests/ui-stable/union_into_bytes_cfg/union_into_bytes_cfg.rs +3 -2
- data/rust-vendor/zerocopy-derive/tests/union_from_bytes.rs +15 -0
- data/rust-vendor/zerocopy-derive/tests/union_from_zeros.rs +14 -0
- data/rust-vendor/zerocopy-derive/tests/union_known_layout.rs +5 -0
- data/rust-vendor/zerocopy-derive/tests/union_no_cell.rs +5 -0
- data/rust-vendor/zerocopy-derive/tests/union_to_bytes.rs +5 -0
- data/rust-vendor/zerocopy-derive/tests/union_try_from_bytes.rs +34 -74
- data/rust-vendor/zerocopy-derive/tests/union_unaligned.rs +4 -1
- data/rust-vendor/zerocopy-derive/tests/unsafe_cell.rs +3 -0
- data/rust-vendor/zmij/.cargo-checksum.json +1 -1
- data/rust-vendor/zmij/.cargo_vcs_info.json +1 -1
- data/rust-vendor/zmij/Cargo.lock +10 -10
- data/rust-vendor/zmij/Cargo.toml +1 -1
- data/rust-vendor/zmij/Cargo.toml.orig +1 -1
- data/rust-vendor/zmij/README.md +1 -1
- data/rust-vendor/zmij/src/lib.rs +132 -158
- data/rust-vendor/zune-jpeg/.cargo-checksum.json +1 -1
- data/rust-vendor/zune-jpeg/.cargo_vcs_info.json +1 -1
- data/rust-vendor/zune-jpeg/Cargo.lock +1 -1
- data/rust-vendor/zune-jpeg/Cargo.toml +1 -1
- data/rust-vendor/zune-jpeg/Cargo.toml.orig +1 -1
- data/rust-vendor/zune-jpeg/src/bitstream.rs +1 -1
- data/rust-vendor/zune-jpeg/src/components.rs +2 -1
- data/rust-vendor/zune-jpeg/src/decoder.rs +3 -23
- data/rust-vendor/zune-jpeg/src/headers.rs +19 -1
- data/rust-vendor/zune-jpeg/src/lib.rs +1 -0
- data/rust-vendor/zune-jpeg/src/mcu.rs +6 -6
- data/rust-vendor/zune-jpeg/src/mcu_prog.rs +22 -34
- data/rust-vendor/zune-jpeg/src/upsampler/avx2.rs +3 -1
- data/rust-vendor/zune-jpeg/src/upsampler/neon.rs +13 -23
- data/rust-vendor/zune-jpeg/src/upsampler/portable_simd.rs +4 -1
- data/rust-vendor/zune-jpeg/src/upsampler/scalar.rs +4 -1
- metadata +41 -8
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-dst-unsized.stderr +0 -183
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-dst-unsized.stderr +0 -183
- data/rust-vendor/zerocopy-derive/src/enum.rs +0 -456
- data/rust-vendor/zerocopy-derive/src/ext.rs +0 -123
- data/rust-vendor/zerocopy-derive/src/output_tests.rs +0 -5608
- data/rust-vendor/zerocopy-derive/tests/crate_path.rs +0 -189
|
@@ -13,7 +13,10 @@ use core::{
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
use crate::{
|
|
16
|
-
pointer::{
|
|
16
|
+
pointer::{
|
|
17
|
+
cast::{self, CastExact, CastSizedExact},
|
|
18
|
+
invariant::*,
|
|
19
|
+
},
|
|
17
20
|
FromBytes, Immutable, IntoBytes, Unalign,
|
|
18
21
|
};
|
|
19
22
|
|
|
@@ -30,26 +33,31 @@ use crate::{
|
|
|
30
33
|
///
|
|
31
34
|
/// ## Post-conditions
|
|
32
35
|
///
|
|
33
|
-
/// Given `Dst: TryTransmuteFromPtr<Src, A, SV, DV, _>`, callers may assume
|
|
34
|
-
/// following:
|
|
36
|
+
/// Given `Dst: TryTransmuteFromPtr<Src, A, SV, DV, C, _>`, callers may assume
|
|
37
|
+
/// the following:
|
|
35
38
|
///
|
|
36
39
|
/// Given `src: Ptr<'a, Src, (A, _, SV)>`, if the referent of `src` is
|
|
37
40
|
/// `DV`-valid for `Dst`, then it is sound to transmute `src` into `dst: Ptr<'a,
|
|
38
|
-
/// Dst, (A, Unaligned, DV)>`
|
|
41
|
+
/// Dst, (A, Unaligned, DV)>` using `C`.
|
|
39
42
|
///
|
|
40
43
|
/// ## Pre-conditions
|
|
41
44
|
///
|
|
42
45
|
/// Given `src: Ptr<Src, (A, _, SV)>` and `dst: Ptr<Dst, (A, Unaligned, DV)>`,
|
|
43
|
-
/// `Dst: TryTransmuteFromPtr<Src, A, SV, DV, _>` is sound if all of the
|
|
46
|
+
/// `Dst: TryTransmuteFromPtr<Src, A, SV, DV, C, _>` is sound if all of the
|
|
44
47
|
/// following hold:
|
|
45
48
|
/// - Forwards transmutation: Either of the following hold:
|
|
46
49
|
/// - So long as `dst` is active, no mutation of `dst`'s referent is allowed
|
|
47
50
|
/// except via `dst` itself
|
|
48
|
-
/// - The set of `DV`-valid `
|
|
49
|
-
/// `
|
|
51
|
+
/// - The set of `DV`-valid referents of `dst` is a superset of the set of
|
|
52
|
+
/// `SV`-valid referents of `src` (NOTE: this condition effectively bans
|
|
53
|
+
/// shrinking or overwriting transmutes, which cannot satisfy this
|
|
54
|
+
/// condition)
|
|
50
55
|
/// - Reverse transmutation: Either of the following hold:
|
|
51
56
|
/// - `dst` does not permit mutation of its referent
|
|
52
|
-
/// - The set of `DV`-valid `
|
|
57
|
+
/// - The set of `DV`-valid referents of `dst` is a subset of the set of
|
|
58
|
+
/// `SV`-valid referents of `src` (NOTE: this condition effectively bans
|
|
59
|
+
/// shrinking or overwriting transmutes, which cannot satisfy this
|
|
60
|
+
/// condition)
|
|
53
61
|
/// - No safe code, given access to `src` and `dst`, can cause undefined
|
|
54
62
|
/// behavior: Any of the following hold:
|
|
55
63
|
/// - `A` is `Exclusive`
|
|
@@ -62,60 +70,51 @@ use crate::{
|
|
|
62
70
|
/// Given:
|
|
63
71
|
/// - `src: Ptr<'a, Src, (A, _, SV)>`
|
|
64
72
|
/// - `src`'s referent is `DV`-valid for `Dst`
|
|
65
|
-
/// - `Dst: SizeEq<Src>`
|
|
66
73
|
///
|
|
67
|
-
/// We are trying to prove that it is sound to perform a
|
|
68
|
-
///
|
|
69
|
-
///
|
|
70
|
-
///
|
|
71
|
-
/// destination `Ptr` type.
|
|
74
|
+
/// We are trying to prove that it is sound to perform a cast from `src` to a
|
|
75
|
+
/// `dst: Ptr<'a, Dst, (A, Unaligned, DV)>` using `C`. We need to prove that
|
|
76
|
+
/// such a cast does not violate any of `src`'s invariants, and that it
|
|
77
|
+
/// satisfies all invariants of the destination `Ptr` type.
|
|
72
78
|
///
|
|
73
|
-
/// First,
|
|
74
|
-
///
|
|
75
|
-
/// - If its referent is not zero sized, then it still has valid provenance for
|
|
76
|
-
/// its referent, which is still entirely contained in some Rust allocation,
|
|
77
|
-
/// `A`
|
|
78
|
-
/// - If its referent is not zero sized, `A` is guaranteed to live for at least
|
|
79
|
-
/// `'a`
|
|
80
|
-
///
|
|
81
|
-
/// Since `Dst: SizeEq<Src>`, and since `dst` has the same address and metadata
|
|
82
|
-
/// as `src`, `dst` addresses the same byte range as `src`. `dst` also has the
|
|
83
|
-
/// same lifetime as `src`. Therefore, all of the `PtrInner` invariants
|
|
84
|
-
/// mentioned above also hold for `dst`.
|
|
85
|
-
///
|
|
86
|
-
/// Second, since `src`'s address is unchanged, it still satisfies its
|
|
87
|
-
/// alignment. Since `dst`'s alignment is `Unaligned`, it trivially satisfies
|
|
79
|
+
/// First, by `C: CastExact`, `src`'s address is unchanged, so it still satisfies
|
|
80
|
+
/// its alignment. Since `dst`'s alignment is `Unaligned`, it trivially satisfies
|
|
88
81
|
/// its alignment.
|
|
89
82
|
///
|
|
90
|
-
///
|
|
83
|
+
/// Second, aliasing is either `Exclusive` or `Shared`:
|
|
91
84
|
/// - If it is `Exclusive`, then both `src` and `dst` satisfy `Exclusive`
|
|
92
85
|
/// aliasing trivially: since `src` and `dst` have the same lifetime, `src` is
|
|
93
86
|
/// inaccessible so long as `dst` is alive, and no other live `Ptr`s or
|
|
94
87
|
/// references may reference the same referent.
|
|
95
88
|
/// - If it is `Shared`, then either:
|
|
96
|
-
/// - `Src: Immutable` and `Dst: Immutable`, and so `
|
|
97
|
-
///
|
|
89
|
+
/// - `Src: Immutable` and `Dst: Immutable`, and so neither `src` nor `dst`
|
|
90
|
+
/// permit interior mutation.
|
|
98
91
|
/// - It is explicitly sound for safe code to operate on a `&Src` and a `&Dst`
|
|
99
92
|
/// pointing to the same byte range at the same time.
|
|
100
93
|
///
|
|
101
|
-
///
|
|
94
|
+
/// Third, `src`'s validity is satisfied. By invariant, `src`'s referent began
|
|
102
95
|
/// as an `SV`-valid `Src`. It is guaranteed to remain so, as either of the
|
|
103
96
|
/// following hold:
|
|
104
97
|
/// - `dst` does not permit mutation of its referent.
|
|
105
|
-
/// - The set of `DV`-valid `
|
|
106
|
-
/// `
|
|
107
|
-
///
|
|
98
|
+
/// - The set of `DV`-valid referents of `dst` is a subset of the set of
|
|
99
|
+
/// `SV`-valid referents of `src`. Thus, any value written via `dst` is
|
|
100
|
+
/// guaranteed to be an `SV`-valid referent of `src`.
|
|
108
101
|
///
|
|
109
|
-
///
|
|
102
|
+
/// Fourth, `dst`'s validity is satisfied. It is a given of this proof that the
|
|
110
103
|
/// referent is `DV`-valid for `Dst`. It is guaranteed to remain so, as either
|
|
111
104
|
/// of the following hold:
|
|
112
105
|
/// - So long as `dst` is active, no mutation of the referent is allowed except
|
|
113
106
|
/// via `dst` itself.
|
|
114
|
-
/// - The set of `DV`-valid `
|
|
115
|
-
/// `
|
|
116
|
-
/// `
|
|
117
|
-
pub unsafe trait TryTransmuteFromPtr<
|
|
118
|
-
|
|
107
|
+
/// - The set of `DV`-valid referents of `dst` is a superset of the set of
|
|
108
|
+
/// `SV`-valid referents of `src`. Thus, any value written via `src` is
|
|
109
|
+
/// guaranteed to be a `DV`-valid referent of `dst`.
|
|
110
|
+
pub unsafe trait TryTransmuteFromPtr<
|
|
111
|
+
Src: ?Sized,
|
|
112
|
+
A: Aliasing,
|
|
113
|
+
SV: Validity,
|
|
114
|
+
DV: Validity,
|
|
115
|
+
C: CastExact<Src, Self>,
|
|
116
|
+
R,
|
|
117
|
+
>
|
|
119
118
|
{
|
|
120
119
|
}
|
|
121
120
|
|
|
@@ -131,27 +130,30 @@ pub enum BecauseMutationCompatible {}
|
|
|
131
130
|
// exists, no mutation is permitted except via that `Ptr`
|
|
132
131
|
// - Aliasing is `Shared`, `Src: Immutable`, and `Dst: Immutable`, in which
|
|
133
132
|
// case no mutation is possible via either `Ptr`
|
|
134
|
-
// -
|
|
135
|
-
//
|
|
136
|
-
// `
|
|
137
|
-
//
|
|
138
|
-
//
|
|
139
|
-
//
|
|
133
|
+
// - Since the underlying cast is size-preserving, `dst` addresses the same
|
|
134
|
+
// referent as `src`. By `Dst: TransmuteFrom<Src, SV, DV>`, the set of
|
|
135
|
+
// `DV`-valid referents of `dst` is a superset of the set of `SV`-valid
|
|
136
|
+
// referents of `src`.
|
|
137
|
+
// - Reverse transmutation: Since the underlying cast is size-preserving, `dst`
|
|
138
|
+
// addresses the same referent as `src`. By `Src: TransmuteFrom<Dst, DV, SV>`,
|
|
139
|
+
// the set of `DV`-valid referents of `src` is a subset of the set of
|
|
140
|
+
// `SV`-valid referents of `dst`.
|
|
140
141
|
// - No safe code, given access to `src` and `dst`, can cause undefined
|
|
141
142
|
// behavior: By `Dst: MutationCompatible<Src, A, SV, DV, _>`, at least one of
|
|
142
143
|
// the following holds:
|
|
143
144
|
// - `A` is `Exclusive`
|
|
144
145
|
// - `Src: Immutable` and `Dst: Immutable`
|
|
145
146
|
// - `Dst: InvariantsEq<Src>`, which guarantees that `Src` and `Dst` have the
|
|
146
|
-
// same invariants, and
|
|
147
|
-
unsafe impl<Src, Dst, SV, DV, A, R>
|
|
148
|
-
TryTransmuteFromPtr<Src, A, SV, DV, (BecauseMutationCompatible, R)> for Dst
|
|
147
|
+
// same invariants, and permit interior mutation on the same byte ranges
|
|
148
|
+
unsafe impl<Src, Dst, SV, DV, A, C, R>
|
|
149
|
+
TryTransmuteFromPtr<Src, A, SV, DV, C, (BecauseMutationCompatible, R)> for Dst
|
|
149
150
|
where
|
|
150
151
|
A: Aliasing,
|
|
151
152
|
SV: Validity,
|
|
152
153
|
DV: Validity,
|
|
153
154
|
Src: TransmuteFrom<Dst, DV, SV> + ?Sized,
|
|
154
|
-
Dst: MutationCompatible<Src, A, SV, DV, R> +
|
|
155
|
+
Dst: MutationCompatible<Src, A, SV, DV, R> + ?Sized,
|
|
156
|
+
C: CastExact<Src, Dst>,
|
|
155
157
|
{
|
|
156
158
|
}
|
|
157
159
|
|
|
@@ -162,12 +164,14 @@ where
|
|
|
162
164
|
// `dst` does not permit mutation of its referent.
|
|
163
165
|
// - No safe code, given access to `src` and `dst`, can cause undefined
|
|
164
166
|
// behavior: `Src: Immutable` and `Dst: Immutable`
|
|
165
|
-
unsafe impl<Src, Dst, SV, DV> TryTransmuteFromPtr<Src, Shared, SV, DV, BecauseImmutable>
|
|
167
|
+
unsafe impl<Src, Dst, SV, DV, C> TryTransmuteFromPtr<Src, Shared, SV, DV, C, BecauseImmutable>
|
|
168
|
+
for Dst
|
|
166
169
|
where
|
|
167
170
|
SV: Validity,
|
|
168
171
|
DV: Validity,
|
|
169
172
|
Src: Immutable + ?Sized,
|
|
170
|
-
Dst: Immutable +
|
|
173
|
+
Dst: Immutable + ?Sized,
|
|
174
|
+
C: CastExact<Src, Dst>,
|
|
171
175
|
{
|
|
172
176
|
}
|
|
173
177
|
|
|
@@ -188,11 +192,11 @@ pub unsafe trait MutationCompatible<Src: ?Sized, A: Aliasing, SV, DV, R> {}
|
|
|
188
192
|
pub enum BecauseRead {}
|
|
189
193
|
|
|
190
194
|
// SAFETY: `Src: Read<A, _>` and `Dst: Read<A, _>`.
|
|
191
|
-
unsafe impl<Src: ?Sized, Dst: ?Sized, A: Aliasing, SV: Validity, DV: Validity, R
|
|
192
|
-
MutationCompatible<Src, A, SV, DV, (BecauseRead,
|
|
195
|
+
unsafe impl<Src: ?Sized, Dst: ?Sized, A: Aliasing, SV: Validity, DV: Validity, R>
|
|
196
|
+
MutationCompatible<Src, A, SV, DV, (BecauseRead, R)> for Dst
|
|
193
197
|
where
|
|
194
198
|
Src: Read<A, R>,
|
|
195
|
-
Dst: Read<A,
|
|
199
|
+
Dst: Read<A, R>,
|
|
196
200
|
{
|
|
197
201
|
}
|
|
198
202
|
|
|
@@ -259,17 +263,30 @@ unsafe impl<T: ?Sized> InvariantsEq<ManuallyDrop<T>> for T {}
|
|
|
259
263
|
///
|
|
260
264
|
/// `Dst: TransmuteFromPtr<Src, A, SV, DV, _>` is equivalent to `Dst:
|
|
261
265
|
/// TryTransmuteFromPtr<Src, A, SV, DV, _> + TransmuteFrom<Src, SV, DV>`.
|
|
262
|
-
pub unsafe trait TransmuteFromPtr<
|
|
263
|
-
|
|
266
|
+
pub unsafe trait TransmuteFromPtr<
|
|
267
|
+
Src: ?Sized,
|
|
268
|
+
A: Aliasing,
|
|
269
|
+
SV: Validity,
|
|
270
|
+
DV: Validity,
|
|
271
|
+
C: CastExact<Src, Self>,
|
|
272
|
+
R,
|
|
273
|
+
>: TryTransmuteFromPtr<Src, A, SV, DV, C, R> + TransmuteFrom<Src, SV, DV>
|
|
264
274
|
{
|
|
265
275
|
}
|
|
266
276
|
|
|
267
277
|
// SAFETY: The `where` bounds are equivalent to the safety invariant on
|
|
268
278
|
// `TransmuteFromPtr`.
|
|
269
|
-
unsafe impl<
|
|
270
|
-
|
|
279
|
+
unsafe impl<
|
|
280
|
+
Src: ?Sized,
|
|
281
|
+
Dst: ?Sized,
|
|
282
|
+
A: Aliasing,
|
|
283
|
+
SV: Validity,
|
|
284
|
+
DV: Validity,
|
|
285
|
+
C: CastExact<Src, Dst>,
|
|
286
|
+
R,
|
|
287
|
+
> TransmuteFromPtr<Src, A, SV, DV, C, R> for Dst
|
|
271
288
|
where
|
|
272
|
-
Dst: TransmuteFrom<Src, SV, DV> + TryTransmuteFromPtr<Src, A, SV, DV, R>,
|
|
289
|
+
Dst: TransmuteFrom<Src, SV, DV> + TryTransmuteFromPtr<Src, A, SV, DV, C, R>,
|
|
273
290
|
{
|
|
274
291
|
}
|
|
275
292
|
|
|
@@ -287,24 +304,26 @@ where
|
|
|
287
304
|
/// DV>` conveys no safety guarantee.
|
|
288
305
|
pub unsafe trait TransmuteFrom<Src: ?Sized, SV, DV> {}
|
|
289
306
|
|
|
307
|
+
/// Carries the ability to perform a size-preserving cast or conversion from a
|
|
308
|
+
/// raw pointer to `Src` to a raw pointer to `Self`.
|
|
309
|
+
///
|
|
310
|
+
/// The cast/conversion is carried by the associated [`CastFrom`] type, and
|
|
311
|
+
/// may be a no-op cast (without updating pointer metadata) or a conversion
|
|
312
|
+
/// which updates pointer metadata.
|
|
313
|
+
///
|
|
290
314
|
/// # Safety
|
|
291
315
|
///
|
|
292
|
-
/// `
|
|
293
|
-
///
|
|
294
|
-
///
|
|
295
|
-
///
|
|
296
|
-
///
|
|
297
|
-
///
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
pub unsafe trait SizeEq<T: ?Sized> {
|
|
301
|
-
type CastFrom: cast::Cast<T, Self>;
|
|
316
|
+
/// `SizeEq` on its own conveys no safety guarantee. Any safety guarantees come
|
|
317
|
+
/// from the safety invariants on the associated [`CastFrom`] type, specifically
|
|
318
|
+
/// the [`CastExact`] bound.
|
|
319
|
+
///
|
|
320
|
+
/// [`CastFrom`]: SizeEq::CastFrom
|
|
321
|
+
/// [`CastExact`]: CastExact
|
|
322
|
+
pub trait SizeEq<Src: ?Sized> {
|
|
323
|
+
type CastFrom: CastExact<Src, Self>;
|
|
302
324
|
}
|
|
303
325
|
|
|
304
|
-
|
|
305
|
-
// pointer `*mut T -> *mut T` pointer casts are no-ops, this cast trivially
|
|
306
|
-
// preserves referent size (when `T: ?Sized`).
|
|
307
|
-
unsafe impl<T: ?Sized> SizeEq<T> for T {
|
|
326
|
+
impl<T: ?Sized> SizeEq<T> for T {
|
|
308
327
|
type CastFrom = cast::IdCast;
|
|
309
328
|
}
|
|
310
329
|
|
|
@@ -458,19 +477,12 @@ impl_transitive_transmute_from!(T: ?Sized => UnsafeCell<T> => T => Cell<T>);
|
|
|
458
477
|
// https://doc.rust-lang.org/1.85.0/core/mem/union.MaybeUninit.html
|
|
459
478
|
unsafe impl<T> TransmuteFrom<T, Uninit, Valid> for MaybeUninit<T> {}
|
|
460
479
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
// [1] Per https://doc.rust-lang.org/1.81.0/std/mem/union.MaybeUninit.html#layout-1:
|
|
464
|
-
//
|
|
465
|
-
// `MaybeUninit<T>` is guaranteed to have the same size, alignment, and ABI as
|
|
466
|
-
// `T`
|
|
467
|
-
unsafe impl<T> SizeEq<T> for MaybeUninit<T> {
|
|
468
|
-
type CastFrom = cast::CastSized;
|
|
480
|
+
impl<T> SizeEq<T> for MaybeUninit<T> {
|
|
481
|
+
type CastFrom = CastSizedExact;
|
|
469
482
|
}
|
|
470
483
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
type CastFrom = cast::CastSized;
|
|
484
|
+
impl<T> SizeEq<MaybeUninit<T>> for T {
|
|
485
|
+
type CastFrom = CastSizedExact;
|
|
474
486
|
}
|
|
475
487
|
|
|
476
488
|
#[cfg(test)]
|
|
@@ -504,23 +516,4 @@ mod tests {
|
|
|
504
516
|
// T: ?Sized => UnsafeCell<T> => T => Cell<T>
|
|
505
517
|
test_size_eq::<UnsafeCell<u8>, Cell<u8>>(UnsafeCell::new(0u8));
|
|
506
518
|
}
|
|
507
|
-
|
|
508
|
-
#[cfg(not(no_zerocopy_target_has_atomics_1_60_0))]
|
|
509
|
-
#[cfg(target_has_atomic = "8")]
|
|
510
|
-
#[test]
|
|
511
|
-
fn test_atomic_u8_transmutes() {
|
|
512
|
-
use core::sync::atomic::AtomicU8;
|
|
513
|
-
|
|
514
|
-
// 1. Atomic -> Prim (SizeEq<Atomic> for Prim)
|
|
515
|
-
test_size_eq::<AtomicU8, u8>(AtomicU8::new(0));
|
|
516
|
-
|
|
517
|
-
// 2. Prim -> Atomic (SizeEq<Prim> for Atomic)
|
|
518
|
-
test_size_eq::<u8, AtomicU8>(0u8);
|
|
519
|
-
|
|
520
|
-
// 3. Atomic -> UnsafeCell<Prim> (SizeEq<Atomic> for UnsafeCell<Prim>)
|
|
521
|
-
test_size_eq::<AtomicU8, UnsafeCell<u8>>(AtomicU8::new(0));
|
|
522
|
-
|
|
523
|
-
// 4. UnsafeCell<Prim> -> Atomic (SizeEq<UnsafeCell<Prim>> for Atomic)
|
|
524
|
-
test_size_eq::<UnsafeCell<u8>, AtomicU8>(UnsafeCell::new(0u8));
|
|
525
|
-
}
|
|
526
519
|
}
|
|
@@ -681,7 +681,7 @@ where
|
|
|
681
681
|
cast_for_sized::<
|
|
682
682
|
T,
|
|
683
683
|
_,
|
|
684
|
-
(BecauseRead,
|
|
684
|
+
(BecauseRead, BecauseExclusive),
|
|
685
685
|
(BecauseMutationCompatible, BecauseInvariantsEq),
|
|
686
686
|
>(ptr)
|
|
687
687
|
};
|
|
@@ -857,7 +857,7 @@ where
|
|
|
857
857
|
cast_for_sized::<
|
|
858
858
|
T,
|
|
859
859
|
_,
|
|
860
|
-
(BecauseRead,
|
|
860
|
+
(BecauseRead, BecauseExclusive),
|
|
861
861
|
(BecauseMutationCompatible, BecauseInvariantsEq),
|
|
862
862
|
>(ptr)
|
|
863
863
|
};
|
|
@@ -876,7 +876,7 @@ where
|
|
|
876
876
|
let ptr = Ptr::from_mut(b)
|
|
877
877
|
.try_cast_into_no_leftover::<T, BecauseExclusive>(None)
|
|
878
878
|
.expect("zerocopy internal error: DerefMut::deref_mut should be infallible");
|
|
879
|
-
let ptr = ptr.recall_validity::<_, (_, (_,
|
|
879
|
+
let ptr = ptr.recall_validity::<_, (_, (_, BecauseExclusive))>();
|
|
880
880
|
ptr.as_mut()
|
|
881
881
|
}
|
|
882
882
|
}
|
|
@@ -960,7 +960,7 @@ where
|
|
|
960
960
|
T: FromBytes + KnownLayout + ?Sized,
|
|
961
961
|
A: crate::invariant::Aliasing,
|
|
962
962
|
[u8]: MutationCompatible<T, A, Initialized, Initialized, R>,
|
|
963
|
-
T: TransmuteFromPtr<T, A, Initialized, Valid, S>,
|
|
963
|
+
T: TransmuteFromPtr<T, A, Initialized, Valid, crate::pointer::cast::IdCast, S>,
|
|
964
964
|
{
|
|
965
965
|
use crate::pointer::cast::{Cast, Project};
|
|
966
966
|
|