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
|
@@ -160,7 +160,7 @@ mod _external {
|
|
|
160
160
|
/// Methods for converting to and from `Ptr` and Rust's safe reference types.
|
|
161
161
|
mod _conversions {
|
|
162
162
|
use super::*;
|
|
163
|
-
use crate::pointer::cast::CastSized;
|
|
163
|
+
use crate::pointer::cast::{CastExact, CastSized, IdCast};
|
|
164
164
|
|
|
165
165
|
/// `&'a T` → `Ptr<'a, T>`
|
|
166
166
|
impl<'a, T> Ptr<'a, T, (Shared, Aligned, Valid)>
|
|
@@ -280,9 +280,8 @@ mod _conversions {
|
|
|
280
280
|
{
|
|
281
281
|
/// Reborrows `self`, producing another `Ptr`.
|
|
282
282
|
///
|
|
283
|
-
/// Since `self` is borrowed
|
|
284
|
-
///
|
|
285
|
-
/// exists.
|
|
283
|
+
/// Since `self` is borrowed mutably, this prevents any methods from
|
|
284
|
+
/// being called on `self` as long as the returned `Ptr` exists.
|
|
286
285
|
#[doc(hidden)]
|
|
287
286
|
#[inline]
|
|
288
287
|
#[allow(clippy::needless_lifetimes)] // Allows us to name the lifetime in the safety comment below.
|
|
@@ -323,6 +322,52 @@ mod _conversions {
|
|
|
323
322
|
// memory may be live.
|
|
324
323
|
unsafe { Ptr::from_inner(self.as_inner()) }
|
|
325
324
|
}
|
|
325
|
+
|
|
326
|
+
/// Reborrows `self` as shared, producing another `Ptr` with `Shared`
|
|
327
|
+
/// aliasing.
|
|
328
|
+
///
|
|
329
|
+
/// Since `self` is borrowed mutably, this prevents any methods from
|
|
330
|
+
/// being called on `self` as long as the returned `Ptr` exists.
|
|
331
|
+
#[doc(hidden)]
|
|
332
|
+
#[inline]
|
|
333
|
+
#[allow(clippy::needless_lifetimes)] // Allows us to name the lifetime in the safety comment below.
|
|
334
|
+
pub fn reborrow_shared<'b>(&'b mut self) -> Ptr<'b, T, (Shared, I::Alignment, I::Validity)>
|
|
335
|
+
where
|
|
336
|
+
'a: 'b,
|
|
337
|
+
{
|
|
338
|
+
// SAFETY: The following all hold by invariant on `self`, and thus
|
|
339
|
+
// hold of `ptr = self.as_inner()`:
|
|
340
|
+
// 0. SEE BELOW.
|
|
341
|
+
// 1. `ptr` conforms to the alignment invariant of
|
|
342
|
+
// [`I::Alignment`](invariant::Alignment).
|
|
343
|
+
// 2. `ptr` conforms to the validity invariant of
|
|
344
|
+
// [`I::Validity`](invariant::Validity). `self` and the returned
|
|
345
|
+
// `Ptr` permit the same bit values in their referents since they
|
|
346
|
+
// have the same referent type (`T`) and the same validity
|
|
347
|
+
// (`I::Validity`). Thus, regardless of what mutation is
|
|
348
|
+
// permitted (`Exclusive` aliasing or `Shared`-aliased interior
|
|
349
|
+
// mutation), neither can be used to write a value to the
|
|
350
|
+
// referent which violates the other's validity invariant.
|
|
351
|
+
//
|
|
352
|
+
// For aliasing (0 above), since `I::Aliasing: Reference`,
|
|
353
|
+
// there are two cases for `I::Aliasing`:
|
|
354
|
+
// - For `invariant::Shared`: `'a` outlives `'b`, and so the
|
|
355
|
+
// returned `Ptr` does not permit accessing the referent any
|
|
356
|
+
// longer than is possible via `self`. For shared aliasing, it is
|
|
357
|
+
// sound for multiple `Ptr`s to exist simultaneously which
|
|
358
|
+
// reference the same memory, so creating a new one is not
|
|
359
|
+
// problematic.
|
|
360
|
+
// - For `invariant::Exclusive`: Since `self` is `&'b mut` and we
|
|
361
|
+
// return a `Ptr` with lifetime `'b`, `self` is inaccessible to
|
|
362
|
+
// the caller for the lifetime `'b` - in other words, `self` is
|
|
363
|
+
// inaccessible to the caller as long as the returned `Ptr`
|
|
364
|
+
// exists. Since `self` is an exclusive `Ptr`, no other live
|
|
365
|
+
// references or `Ptr`s may exist which refer to the same memory
|
|
366
|
+
// while `self` is live. Thus, as long as the returned `Ptr`
|
|
367
|
+
// exists, no other references or `Ptr`s which refer to the same
|
|
368
|
+
// memory may be live.
|
|
369
|
+
unsafe { Ptr::from_inner(self.as_inner()) }
|
|
370
|
+
}
|
|
326
371
|
}
|
|
327
372
|
|
|
328
373
|
/// `Ptr<'a, T>` → `&'a mut T`
|
|
@@ -378,15 +423,28 @@ mod _conversions {
|
|
|
378
423
|
where
|
|
379
424
|
I: Invariants,
|
|
380
425
|
{
|
|
381
|
-
|
|
426
|
+
#[must_use]
|
|
427
|
+
#[inline(always)]
|
|
428
|
+
pub fn transmute<U, V, R>(self) -> Ptr<'a, U, (I::Aliasing, Unaligned, V)>
|
|
429
|
+
where
|
|
430
|
+
V: Validity,
|
|
431
|
+
U: TransmuteFromPtr<T, I::Aliasing, I::Validity, V, <U as SizeEq<T>>::CastFrom, R>
|
|
432
|
+
+ SizeEq<T>
|
|
433
|
+
+ ?Sized,
|
|
434
|
+
{
|
|
435
|
+
self.transmute_with::<U, V, <U as SizeEq<T>>::CastFrom, R>()
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
pub(crate) fn transmute_with<U, V, C, R>(self) -> Ptr<'a, U, (I::Aliasing, Unaligned, V)>
|
|
382
439
|
where
|
|
383
440
|
V: Validity,
|
|
384
|
-
U: TransmuteFromPtr<T, I::Aliasing, I::Validity, V, R> +
|
|
441
|
+
U: TransmuteFromPtr<T, I::Aliasing, I::Validity, V, C, R> + ?Sized,
|
|
442
|
+
C: CastExact<T, U>,
|
|
385
443
|
{
|
|
386
444
|
// SAFETY:
|
|
387
|
-
// - By `
|
|
388
|
-
//
|
|
389
|
-
//
|
|
445
|
+
// - By `C: CastExact`, `C` preserves referent address, and so we
|
|
446
|
+
// don't need to consider projections in the following safety
|
|
447
|
+
// arguments.
|
|
390
448
|
// - If aliasing is `Shared`, then by `U: TransmuteFromPtr<T>`, at
|
|
391
449
|
// least one of the following holds:
|
|
392
450
|
// - `T: Immutable` and `U: Immutable`, in which case it is
|
|
@@ -394,9 +452,9 @@ mod _conversions {
|
|
|
394
452
|
// at the same time, as neither can perform interior mutation
|
|
395
453
|
// - It is directly guaranteed that it is sound for shared code to
|
|
396
454
|
// operate on these references simultaneously
|
|
397
|
-
// - By `U: TransmuteFromPtr<T, I::Aliasing, I::Validity, V>`, it
|
|
398
|
-
// sound to perform this transmute
|
|
399
|
-
unsafe { self.project_transmute_unchecked::<_, _,
|
|
455
|
+
// - By `U: TransmuteFromPtr<T, I::Aliasing, I::Validity, C, V>`, it
|
|
456
|
+
// is sound to perform this transmute using `C`.
|
|
457
|
+
unsafe { self.project_transmute_unchecked::<_, _, C>() }
|
|
400
458
|
}
|
|
401
459
|
|
|
402
460
|
#[doc(hidden)]
|
|
@@ -405,18 +463,9 @@ mod _conversions {
|
|
|
405
463
|
pub fn recall_validity<V, R>(self) -> Ptr<'a, T, (I::Aliasing, I::Alignment, V)>
|
|
406
464
|
where
|
|
407
465
|
V: Validity,
|
|
408
|
-
T: TransmuteFromPtr<T, I::Aliasing, I::Validity, V, R>,
|
|
466
|
+
T: TransmuteFromPtr<T, I::Aliasing, I::Validity, V, IdCast, R>,
|
|
409
467
|
{
|
|
410
|
-
|
|
411
|
-
// - By `SizeEq::CastFrom: Cast`, `SizeEq::CastFrom` preserves
|
|
412
|
-
// referent address, and so we don't need to consider projections
|
|
413
|
-
// in the following safety arguments.
|
|
414
|
-
// - It is trivially sound to have multiple `&T` referencing the
|
|
415
|
-
// same referent simultaneously
|
|
416
|
-
// - By `T: TransmuteFromPtr<T, I::Aliasing, I::Validity, V>`, it is
|
|
417
|
-
// sound to perform this transmute.
|
|
418
|
-
let ptr =
|
|
419
|
-
unsafe { self.project_transmute_unchecked::<_, _, <T as SizeEq<T>>::CastFrom>() };
|
|
468
|
+
let ptr = self.transmute_with::<T, V, IdCast, R>();
|
|
420
469
|
// SAFETY: `self` and `ptr` have the same address and referent type.
|
|
421
470
|
// Therefore, if `self` satisfies `I::Alignment`, then so does
|
|
422
471
|
// `ptr`.
|
|
@@ -444,7 +493,8 @@ mod _conversions {
|
|
|
444
493
|
/// subtle soundness requirement that is a function of `T`, `U`,
|
|
445
494
|
/// `I::Aliasing`, `I::Validity`, and `V`, and may depend upon the
|
|
446
495
|
/// presence, absence, or specific location of `UnsafeCell`s in `T`
|
|
447
|
-
/// and/or `U
|
|
496
|
+
/// and/or `U`, and on whether interior mutation is ever permitted via
|
|
497
|
+
/// those `UnsafeCell`s. See [`Validity`] for more details.
|
|
448
498
|
#[doc(hidden)]
|
|
449
499
|
#[inline(always)]
|
|
450
500
|
#[must_use]
|
|
@@ -499,6 +549,11 @@ mod _conversions {
|
|
|
499
549
|
pub(crate) fn into_unalign(
|
|
500
550
|
self,
|
|
501
551
|
) -> Ptr<'a, crate::Unalign<T>, (I::Aliasing, Aligned, I::Validity)> {
|
|
552
|
+
// FIXME(#1359): This should be a `transmute_with` call.
|
|
553
|
+
// Unfortunately, to avoid blanket impl conflicts, we only implement
|
|
554
|
+
// `TransmuteFrom<T>` for `Unalign<T>` (and vice versa) specifically
|
|
555
|
+
// for `Valid` validity, not for all validity types.
|
|
556
|
+
|
|
502
557
|
// SAFETY:
|
|
503
558
|
// - By `CastSized: Cast`, `CastSized` preserves referent address,
|
|
504
559
|
// and so we don't need to consider projections in the following
|
|
@@ -555,50 +610,16 @@ mod _conversions {
|
|
|
555
610
|
/// State transitions between invariants.
|
|
556
611
|
mod _transitions {
|
|
557
612
|
use super::*;
|
|
558
|
-
use crate::
|
|
613
|
+
use crate::{
|
|
614
|
+
pointer::{cast::IdCast, transmute::TryTransmuteFromPtr},
|
|
615
|
+
ReadOnly,
|
|
616
|
+
};
|
|
559
617
|
|
|
560
618
|
impl<'a, T, I> Ptr<'a, T, I>
|
|
561
619
|
where
|
|
562
620
|
T: 'a + ?Sized,
|
|
563
621
|
I: Invariants,
|
|
564
622
|
{
|
|
565
|
-
/// Returns a `Ptr` with [`Exclusive`] aliasing if `self` already has
|
|
566
|
-
/// `Exclusive` aliasing, or generates a compile-time assertion failure.
|
|
567
|
-
///
|
|
568
|
-
/// This allows code which is generic over aliasing to down-cast to a
|
|
569
|
-
/// concrete aliasing.
|
|
570
|
-
///
|
|
571
|
-
/// [`Exclusive`]: crate::pointer::invariant::Exclusive
|
|
572
|
-
#[inline]
|
|
573
|
-
pub(crate) fn into_exclusive_or_pme(
|
|
574
|
-
self,
|
|
575
|
-
) -> Ptr<'a, T, (Exclusive, I::Alignment, I::Validity)> {
|
|
576
|
-
// NOTE(https://github.com/rust-lang/rust/issues/131625): We do this
|
|
577
|
-
// rather than just having `Aliasing::IS_EXCLUSIVE` have the panic
|
|
578
|
-
// behavior because doing it that way causes rustdoc to fail while
|
|
579
|
-
// attempting to document hidden items (since it evaluates the
|
|
580
|
-
// constant - and thus panics).
|
|
581
|
-
trait AliasingExt: Aliasing {
|
|
582
|
-
const IS_EXCL: bool;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
impl<A: Aliasing> AliasingExt for A {
|
|
586
|
-
const IS_EXCL: bool = {
|
|
587
|
-
const_assert!(Self::IS_EXCLUSIVE);
|
|
588
|
-
true
|
|
589
|
-
};
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
assert!(I::Aliasing::IS_EXCL);
|
|
593
|
-
|
|
594
|
-
// SAFETY: We've confirmed that `self` already has the aliasing
|
|
595
|
-
// `Exclusive`. If it didn't, either the preceding assert would fail
|
|
596
|
-
// or evaluating `I::Aliasing::IS_EXCL` would fail. We're *pretty*
|
|
597
|
-
// sure that it's guaranteed to fail const eval, but the `assert!`
|
|
598
|
-
// provides a backstop in case that doesn't work.
|
|
599
|
-
unsafe { self.assume_exclusive() }
|
|
600
|
-
}
|
|
601
|
-
|
|
602
623
|
/// Assumes that `self` satisfies the invariants `H`.
|
|
603
624
|
///
|
|
604
625
|
/// # Safety
|
|
@@ -623,38 +644,6 @@ mod _transitions {
|
|
|
623
644
|
unsafe { self.assume_invariants::<H>() }
|
|
624
645
|
}
|
|
625
646
|
|
|
626
|
-
/// Assumes that `self` satisfies the aliasing requirement of `A`.
|
|
627
|
-
///
|
|
628
|
-
/// # Safety
|
|
629
|
-
///
|
|
630
|
-
/// The caller promises that `self` satisfies the aliasing requirement
|
|
631
|
-
/// of `A`.
|
|
632
|
-
#[inline]
|
|
633
|
-
pub(crate) unsafe fn assume_aliasing<A: Aliasing>(
|
|
634
|
-
self,
|
|
635
|
-
) -> Ptr<'a, T, (A, I::Alignment, I::Validity)> {
|
|
636
|
-
// SAFETY: The caller promises that `self` satisfies the aliasing
|
|
637
|
-
// requirements of `A`.
|
|
638
|
-
unsafe { self.assume_invariants() }
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
/// Assumes `self` satisfies the aliasing requirement of [`Exclusive`].
|
|
642
|
-
///
|
|
643
|
-
/// # Safety
|
|
644
|
-
///
|
|
645
|
-
/// The caller promises that `self` satisfies the aliasing requirement
|
|
646
|
-
/// of `Exclusive`.
|
|
647
|
-
///
|
|
648
|
-
/// [`Exclusive`]: crate::pointer::invariant::Exclusive
|
|
649
|
-
#[inline]
|
|
650
|
-
pub(crate) unsafe fn assume_exclusive(
|
|
651
|
-
self,
|
|
652
|
-
) -> Ptr<'a, T, (Exclusive, I::Alignment, I::Validity)> {
|
|
653
|
-
// SAFETY: The caller promises that `self` satisfies the aliasing
|
|
654
|
-
// requirements of `Exclusive`.
|
|
655
|
-
unsafe { self.assume_aliasing::<Exclusive>() }
|
|
656
|
-
}
|
|
657
|
-
|
|
658
647
|
/// Assumes that `self`'s referent is validly-aligned for `T` if
|
|
659
648
|
/// required by `A`.
|
|
660
649
|
///
|
|
@@ -754,59 +743,6 @@ mod _transitions {
|
|
|
754
743
|
unsafe { self.assume_validity::<Valid>() }
|
|
755
744
|
}
|
|
756
745
|
|
|
757
|
-
/// Recalls that `self`'s referent is initialized.
|
|
758
|
-
#[doc(hidden)]
|
|
759
|
-
#[must_use]
|
|
760
|
-
#[inline]
|
|
761
|
-
// FIXME(#859): Reconsider the name of this method before making it
|
|
762
|
-
// public.
|
|
763
|
-
pub fn bikeshed_recall_initialized_from_bytes(
|
|
764
|
-
self,
|
|
765
|
-
) -> Ptr<'a, T, (I::Aliasing, I::Alignment, Initialized)>
|
|
766
|
-
where
|
|
767
|
-
T: crate::IntoBytes + crate::FromBytes,
|
|
768
|
-
I: Invariants<Validity = Valid>,
|
|
769
|
-
{
|
|
770
|
-
// SAFETY: The `T: IntoBytes + FromBytes` bound ensures that `T`'s
|
|
771
|
-
// bit validity is equivalent to `[u8]`. In other words, the set of
|
|
772
|
-
// allowed referents for a `Ptr<T, (_, _, Valid)>` is the set of
|
|
773
|
-
// initialized bit patterns. The same is true of the set of allowed
|
|
774
|
-
// referents for any `Ptr<_, (_, _, Initialized)>`. Thus, this call
|
|
775
|
-
// does not change the set of allowed values in the referent.
|
|
776
|
-
unsafe { self.assume_initialized() }
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
/// Recalls that `self`'s referent is initialized.
|
|
780
|
-
#[doc(hidden)]
|
|
781
|
-
#[must_use]
|
|
782
|
-
#[inline]
|
|
783
|
-
// FIXME(#859): Reconsider the name of this method before making it
|
|
784
|
-
// public.
|
|
785
|
-
pub fn bikeshed_recall_initialized_immutable(
|
|
786
|
-
self,
|
|
787
|
-
) -> Ptr<'a, T, (Shared, I::Alignment, Initialized)>
|
|
788
|
-
where
|
|
789
|
-
T: crate::IntoBytes + crate::Immutable,
|
|
790
|
-
I: Invariants<Aliasing = Shared, Validity = Valid>,
|
|
791
|
-
{
|
|
792
|
-
// SAFETY: Let `O` (for "old") be the set of allowed bit patterns in
|
|
793
|
-
// `self`'s referent, and let `N` (for "new") be the set of allowed
|
|
794
|
-
// bit patterns in the referent of the returned `Ptr`. `T:
|
|
795
|
-
// IntoBytes` and `I: Invariants<Validity = Valid>` ensures that `O`
|
|
796
|
-
// cannot contain any uninitialized bit patterns. Since the returned
|
|
797
|
-
// `Ptr` has validity `Initialized`, `N` is equal to the set of all
|
|
798
|
-
// initialized bit patterns. Thus, `O` is a subset of `N`, and so
|
|
799
|
-
// the returned `Ptr`'s validity invariant is upheld.
|
|
800
|
-
//
|
|
801
|
-
// Since `T: Immutable` and aliasing is `Shared`, the returned `Ptr`
|
|
802
|
-
// cannot be used to modify the referent. Before this call, `self`'s
|
|
803
|
-
// referent is guaranteed by invariant on `Ptr` to satisfy `self`'s
|
|
804
|
-
// validity invariant. Since the returned `Ptr` cannot be used to
|
|
805
|
-
// modify the referent, this guarantee cannot be violated by the
|
|
806
|
-
// returned `Ptr` (even if `O` is a strict subset of `N`).
|
|
807
|
-
unsafe { self.assume_initialized() }
|
|
808
|
-
}
|
|
809
|
-
|
|
810
746
|
/// Checks that `self`'s referent is validly initialized for `T`,
|
|
811
747
|
/// returning a `Ptr` with `Valid` on success.
|
|
812
748
|
///
|
|
@@ -826,14 +762,15 @@ mod _transitions {
|
|
|
826
762
|
where
|
|
827
763
|
T: TryFromBytes
|
|
828
764
|
+ Read<I::Aliasing, R>
|
|
829
|
-
+ TryTransmuteFromPtr<T, I::Aliasing, I::Validity, Valid, S>,
|
|
765
|
+
+ TryTransmuteFromPtr<T, I::Aliasing, I::Validity, Valid, IdCast, S>,
|
|
766
|
+
ReadOnly<T>: Read<I::Aliasing, R>,
|
|
830
767
|
I::Aliasing: Reference,
|
|
831
768
|
I: Invariants<Validity = Initialized>,
|
|
832
769
|
{
|
|
833
770
|
// This call may panic. If that happens, it doesn't cause any
|
|
834
771
|
// soundness issues, as we have not generated any invalid state
|
|
835
772
|
// which we need to fix before returning.
|
|
836
|
-
if T::is_bit_valid(self.reborrow().
|
|
773
|
+
if T::is_bit_valid(self.reborrow().transmute::<_, _, _>().reborrow_shared()) {
|
|
837
774
|
// SAFETY: If `T::is_bit_valid`, code may assume that `self`
|
|
838
775
|
// contains a bit-valid instance of `T`. By `T:
|
|
839
776
|
// TryTransmuteFromPtr<T, I::Aliasing, I::Validity, Valid>`, so
|
|
@@ -864,7 +801,7 @@ mod _casts {
|
|
|
864
801
|
use super::*;
|
|
865
802
|
use crate::{
|
|
866
803
|
pointer::cast::{AsBytesCast, Cast},
|
|
867
|
-
|
|
804
|
+
HasTag, ProjectField,
|
|
868
805
|
};
|
|
869
806
|
|
|
870
807
|
impl<'a, T, I> Ptr<'a, T, I>
|
|
@@ -929,42 +866,58 @@ mod _casts {
|
|
|
929
866
|
unsafe { self.cast_unchecked::<_, C>() }
|
|
930
867
|
}
|
|
931
868
|
|
|
932
|
-
// FIXME(#196): Support all validity invariants (not just those that are
|
|
933
|
-
// `CastableFrom`).
|
|
934
|
-
#[must_use]
|
|
935
869
|
#[inline(always)]
|
|
936
|
-
pub fn project<F, const FIELD_ID: i128>(
|
|
937
|
-
self,
|
|
938
|
-
) -> Ptr<'a, T::Type,
|
|
870
|
+
pub fn project<F, const VARIANT_ID: i128, const FIELD_ID: i128>(
|
|
871
|
+
mut self,
|
|
872
|
+
) -> Result<Ptr<'a, T::Type, T::Invariants>, T::Error>
|
|
939
873
|
where
|
|
940
|
-
T:
|
|
941
|
-
|
|
874
|
+
T: ProjectField<F, I, VARIANT_ID, FIELD_ID>,
|
|
875
|
+
I::Aliasing: Reference,
|
|
942
876
|
{
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
877
|
+
use crate::pointer::cast::Projection;
|
|
878
|
+
match T::is_projectable(self.reborrow().project_tag()) {
|
|
879
|
+
Ok(()) => {
|
|
880
|
+
let inner = self.as_inner();
|
|
881
|
+
let projected = inner.project::<_, Projection<F, VARIANT_ID, FIELD_ID>>();
|
|
882
|
+
// SAFETY: By `T: ProjectField<F, I, VARIANT_ID, FIELD_ID>`,
|
|
883
|
+
// for `self: Ptr<'_, T, I>` such that `T::is_projectable`
|
|
884
|
+
// (which we've verified in this match arm),
|
|
885
|
+
// `T::project(self.as_inner())` conforms to
|
|
886
|
+
// `T::Invariants`. The `projected` pointer satisfies these
|
|
887
|
+
// invariants because it is produced by way of an
|
|
888
|
+
// abstraction that is equivalent to
|
|
889
|
+
// `T::project(ptr.as_inner())`: by invariant on
|
|
890
|
+
// `PtrInner::project`, `projected` is guaranteed to address
|
|
891
|
+
// the subset of the bytes of `inner`'s referent addressed
|
|
892
|
+
// by `Projection::project(inner)`, and by invariant on
|
|
893
|
+
// `Projection`, `Projection::project` is implemented by
|
|
894
|
+
// delegating to an implementation of `HasField::project`.
|
|
895
|
+
Ok(unsafe { Ptr::from_inner(projected) })
|
|
896
|
+
}
|
|
897
|
+
Err(err) => Err(err),
|
|
898
|
+
}
|
|
899
|
+
}
|
|
948
900
|
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
//
|
|
956
|
-
//
|
|
957
|
-
|
|
958
|
-
//
|
|
959
|
-
//
|
|
960
|
-
unsafe {
|
|
901
|
+
#[must_use]
|
|
902
|
+
#[inline(always)]
|
|
903
|
+
pub(crate) fn project_tag(self) -> Ptr<'a, T::Tag, I>
|
|
904
|
+
where
|
|
905
|
+
T: HasTag,
|
|
906
|
+
{
|
|
907
|
+
// SAFETY: By invariant on `Self::ProjectToTag`, this is a sound
|
|
908
|
+
// projection.
|
|
909
|
+
let tag = unsafe { self.project_transmute_unchecked::<_, _, T::ProjectToTag>() };
|
|
910
|
+
// SAFETY: By invariant on `Self::ProjectToTag`, the projected
|
|
911
|
+
// pointer has the same alignment as `ptr`.
|
|
912
|
+
let tag = unsafe { tag.assume_alignment() };
|
|
913
|
+
tag.unify_invariants()
|
|
961
914
|
}
|
|
962
915
|
}
|
|
963
916
|
|
|
964
917
|
impl<'a, T, I> Ptr<'a, T, I>
|
|
965
918
|
where
|
|
966
919
|
T: 'a + KnownLayout + ?Sized,
|
|
967
|
-
I: Invariants
|
|
920
|
+
I: Invariants,
|
|
968
921
|
{
|
|
969
922
|
/// Casts this pointer-to-initialized into a pointer-to-bytes.
|
|
970
923
|
#[allow(clippy::wrong_self_convention)]
|
|
@@ -972,11 +925,9 @@ mod _casts {
|
|
|
972
925
|
#[inline]
|
|
973
926
|
pub fn as_bytes<R>(self) -> Ptr<'a, [u8], (I::Aliasing, Aligned, Valid)>
|
|
974
927
|
where
|
|
975
|
-
|
|
976
|
-
I::Aliasing: Reference,
|
|
928
|
+
[u8]: TransmuteFromPtr<T, I::Aliasing, I::Validity, Valid, AsBytesCast, R>,
|
|
977
929
|
{
|
|
978
|
-
|
|
979
|
-
ptr.bikeshed_recall_aligned().recall_validity::<Valid, (_, (_, _))>()
|
|
930
|
+
self.transmute_with::<[u8], Valid, AsBytesCast, _>().bikeshed_recall_aligned()
|
|
980
931
|
}
|
|
981
932
|
}
|
|
982
933
|
|
|
@@ -1125,9 +1076,9 @@ mod _casts {
|
|
|
1125
1076
|
where
|
|
1126
1077
|
I::Aliasing: Reference,
|
|
1127
1078
|
U: 'a + ?Sized + KnownLayout + Read<I::Aliasing, R>,
|
|
1079
|
+
[u8]: Read<I::Aliasing, R>,
|
|
1128
1080
|
{
|
|
1129
|
-
// FIXME(#67): Remove this allow. See
|
|
1130
|
-
// details.
|
|
1081
|
+
// FIXME(#67): Remove this allow. See NonNullExt for more details.
|
|
1131
1082
|
#[allow(unstable_name_collisions)]
|
|
1132
1083
|
match self.try_cast_into(CastType::Prefix, meta) {
|
|
1133
1084
|
Ok((slf, remainder)) => {
|