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
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
use core::{fmt, hash::Hash};
|
|
10
10
|
|
|
11
11
|
use super::*;
|
|
12
|
+
use crate::pointer::{invariant::Valid, SizeEq, TransmuteFrom};
|
|
12
13
|
|
|
13
14
|
/// A type with no alignment requirement.
|
|
14
15
|
///
|
|
@@ -137,8 +138,8 @@ impl_known_layout!(T => Unalign<T>);
|
|
|
137
138
|
// Unaligned`.
|
|
138
139
|
// - `Unalign<T>` has the same bit validity as `T`, and so it is `FromZeros`,
|
|
139
140
|
// `FromBytes`, or `IntoBytes` exactly when `T` is as well.
|
|
140
|
-
// - `Immutable`: `Unalign<T>` has the same fields as `T`, so it
|
|
141
|
-
//
|
|
141
|
+
// - `Immutable`: `Unalign<T>` has the same fields as `T`, so it permits
|
|
142
|
+
// interior mutation exactly when `T` does.
|
|
142
143
|
// - `TryFromBytes`: `Unalign<T>` has the same the same bit validity as `T`, so
|
|
143
144
|
// `T::is_bit_valid` is a sound implementation of `is_bit_valid`.
|
|
144
145
|
//
|
|
@@ -148,7 +149,7 @@ const _: () = unsafe {
|
|
|
148
149
|
impl_or_verify!(T: Immutable => Immutable for Unalign<T>);
|
|
149
150
|
impl_or_verify!(
|
|
150
151
|
T: TryFromBytes => TryFromBytes for Unalign<T>;
|
|
151
|
-
|c| T::is_bit_valid(c.transmute())
|
|
152
|
+
|c| T::is_bit_valid(c.transmute::<_, _, BecauseImmutable>())
|
|
152
153
|
);
|
|
153
154
|
impl_or_verify!(T: FromZeros => FromZeros for Unalign<T>);
|
|
154
155
|
impl_or_verify!(T: FromBytes => FromBytes for Unalign<T>);
|
|
@@ -594,6 +595,251 @@ impl<T: ?Sized + KnownLayout> fmt::Debug for MaybeUninit<T> {
|
|
|
594
595
|
}
|
|
595
596
|
}
|
|
596
597
|
|
|
598
|
+
#[allow(unreachable_pub)] // False positive on MSRV
|
|
599
|
+
#[doc(hidden)]
|
|
600
|
+
pub use read_only_def::*;
|
|
601
|
+
mod read_only_def {
|
|
602
|
+
/// A read-only wrapper.
|
|
603
|
+
///
|
|
604
|
+
/// A `ReadOnly<T>` disables any interior mutability in `T`, ensuring that
|
|
605
|
+
/// a `&ReadOnly<T>` is genuinely read-only. Thus, `ReadOnly<T>` is
|
|
606
|
+
/// [`Immutable`] regardless of whether `T` is.
|
|
607
|
+
///
|
|
608
|
+
/// Note that `&mut ReadOnly<T>` still permits mutation – the read-only
|
|
609
|
+
/// property only applies to shared references.
|
|
610
|
+
///
|
|
611
|
+
/// [`Immutable`]: crate::Immutable
|
|
612
|
+
#[repr(transparent)]
|
|
613
|
+
pub struct ReadOnly<T: ?Sized> {
|
|
614
|
+
// INVARIANT: `inner` is never mutated through a `&ReadOnly<T>`
|
|
615
|
+
// reference.
|
|
616
|
+
inner: T,
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
impl<T> ReadOnly<T> {
|
|
620
|
+
/// Creates a new `ReadOnly`.
|
|
621
|
+
#[must_use]
|
|
622
|
+
#[inline(always)]
|
|
623
|
+
pub const fn new(t: T) -> ReadOnly<T> {
|
|
624
|
+
ReadOnly { inner: t }
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/// Returns the inner value.
|
|
628
|
+
#[must_use]
|
|
629
|
+
#[inline(always)]
|
|
630
|
+
pub fn into_inner(r: ReadOnly<T>) -> T {
|
|
631
|
+
r.inner
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
impl<T: ?Sized> ReadOnly<T> {
|
|
636
|
+
#[inline(always)]
|
|
637
|
+
pub(crate) fn as_mut(r: &mut ReadOnly<T>) -> &mut T {
|
|
638
|
+
// SAFETY: `r: &mut ReadOnly`, so this doesn't violate the invariant
|
|
639
|
+
// that `inner` is never mutated through a `&ReadOnly<T>` reference.
|
|
640
|
+
&mut r.inner
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/// # Safety
|
|
644
|
+
///
|
|
645
|
+
/// The caller promises not to mutate the referent (i.e., via interior
|
|
646
|
+
/// mutation).
|
|
647
|
+
pub(crate) const unsafe fn as_ref_unchecked(r: &ReadOnly<T>) -> &T {
|
|
648
|
+
// SAFETY: The caller promises not to mutate the referent.
|
|
649
|
+
&r.inner
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// SAFETY: `ReadOnly<T>` is a `#[repr(transparent)` wrapper around `T`.
|
|
655
|
+
const _: () = unsafe {
|
|
656
|
+
unsafe_impl_known_layout!(T: ?Sized + KnownLayout => #[repr(T)] ReadOnly<T>);
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
#[allow(clippy::multiple_unsafe_ops_per_block)]
|
|
660
|
+
// SAFETY:
|
|
661
|
+
// - `ReadOnly<T>` has the same alignment as `T`, and so it is `Unaligned`
|
|
662
|
+
// exactly when `T` is as well.
|
|
663
|
+
// - `ReadOnly<T>` has the same bit validity as `T`, and so this `is_bit_valid`
|
|
664
|
+
// implementation is correct, and thus the `TryFromBytes` impl is sound.
|
|
665
|
+
// - `ReadOnly<T>` has the same bit validity as `T`, and so it is `FromZeros`,
|
|
666
|
+
// `FromBytes`, and `IntoBytes` exactly when `T` is as well.
|
|
667
|
+
const _: () = unsafe {
|
|
668
|
+
unsafe_impl!(T: ?Sized + Unaligned => Unaligned for ReadOnly<T>);
|
|
669
|
+
unsafe_impl!(
|
|
670
|
+
T: ?Sized + TryFromBytes => TryFromBytes for ReadOnly<T>;
|
|
671
|
+
|c| T::is_bit_valid(c.cast::<_, <ReadOnly<T> as SizeEq<ReadOnly<ReadOnly<T>>>>::CastFrom, _>())
|
|
672
|
+
);
|
|
673
|
+
unsafe_impl!(T: ?Sized + FromZeros => FromZeros for ReadOnly<T>);
|
|
674
|
+
unsafe_impl!(T: ?Sized + FromBytes => FromBytes for ReadOnly<T>);
|
|
675
|
+
unsafe_impl!(T: ?Sized + IntoBytes => IntoBytes for ReadOnly<T>);
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
// SAFETY: By invariant, `inner` is never mutated through a `&ReadOnly<T>`
|
|
679
|
+
// reference.
|
|
680
|
+
const _: () = unsafe {
|
|
681
|
+
unsafe_impl!(T: ?Sized => Immutable for ReadOnly<T>);
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
const _: () = {
|
|
685
|
+
use crate::pointer::cast::CastExact;
|
|
686
|
+
|
|
687
|
+
// SAFETY: `ReadOnly<T>` has the same layout as `T`.
|
|
688
|
+
define_cast!(unsafe { pub CastFromReadOnly<T: ?Sized> = ReadOnly<T> => T});
|
|
689
|
+
// SAFETY: `ReadOnly<T>` has the same layout as `T`.
|
|
690
|
+
unsafe impl<T: ?Sized> CastExact<ReadOnly<T>, T> for CastFromReadOnly {}
|
|
691
|
+
// SAFETY: `ReadOnly<T>` has the same layout as `T`.
|
|
692
|
+
define_cast!(unsafe { pub CastToReadOnly<T: ?Sized> = T => ReadOnly<T>});
|
|
693
|
+
// SAFETY: `ReadOnly<T>` has the same layout as `T`.
|
|
694
|
+
unsafe impl<T: ?Sized> CastExact<T, ReadOnly<T>> for CastToReadOnly {}
|
|
695
|
+
|
|
696
|
+
impl<T: ?Sized> SizeEq<ReadOnly<T>> for T {
|
|
697
|
+
type CastFrom = CastFromReadOnly;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
impl<T: ?Sized> SizeEq<T> for ReadOnly<T> {
|
|
701
|
+
type CastFrom = CastToReadOnly;
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
// SAFETY: `ReadOnly<T>` is a `#[repr(transparent)]` wrapper around `T`, and so
|
|
706
|
+
// it has the same bit validity as `T`.
|
|
707
|
+
unsafe impl<T: ?Sized> TransmuteFrom<T, Valid, Valid> for ReadOnly<T> {}
|
|
708
|
+
|
|
709
|
+
// SAFETY: `ReadOnly<T>` is a `#[repr(transparent)]` wrapper around `T`, and so
|
|
710
|
+
// it has the same bit validity as `T`.
|
|
711
|
+
unsafe impl<T: ?Sized> TransmuteFrom<ReadOnly<T>, Valid, Valid> for T {}
|
|
712
|
+
|
|
713
|
+
impl<'a, T: ?Sized + Immutable> From<&'a T> for &'a ReadOnly<T> {
|
|
714
|
+
#[inline(always)]
|
|
715
|
+
fn from(t: &'a T) -> &'a ReadOnly<T> {
|
|
716
|
+
let ro = Ptr::from_ref(t).transmute::<_, _, (_, _)>();
|
|
717
|
+
// SAFETY: `ReadOnly<T>` has the same alignment as `T`, and
|
|
718
|
+
// `Ptr::from_ref` produces an aligned `Ptr`.
|
|
719
|
+
let ro = unsafe { ro.assume_alignment() };
|
|
720
|
+
ro.as_ref()
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
impl<T: ?Sized + Immutable> Deref for ReadOnly<T> {
|
|
725
|
+
type Target = T;
|
|
726
|
+
|
|
727
|
+
#[inline(always)]
|
|
728
|
+
fn deref(&self) -> &Self::Target {
|
|
729
|
+
// SAFETY: By `T: Immutable`, `&T` doesn't permit interior mutation.
|
|
730
|
+
unsafe { ReadOnly::as_ref_unchecked(self) }
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
impl<T: ?Sized + Immutable> DerefMut for ReadOnly<T> {
|
|
735
|
+
#[inline(always)]
|
|
736
|
+
fn deref_mut(&mut self) -> &mut Self::Target {
|
|
737
|
+
ReadOnly::as_mut(self)
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
impl<T: ?Sized + Immutable + Debug> Debug for ReadOnly<T> {
|
|
742
|
+
#[inline(always)]
|
|
743
|
+
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
|
744
|
+
self.deref().fmt(f)
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
// SAFETY: See safety comment on `ProjectToTag`.
|
|
749
|
+
unsafe impl<T: HasTag + ?Sized> HasTag for ReadOnly<T> {
|
|
750
|
+
#[allow(clippy::missing_inline_in_public_items)]
|
|
751
|
+
fn only_derive_is_allowed_to_implement_this_trait()
|
|
752
|
+
where
|
|
753
|
+
Self: Sized,
|
|
754
|
+
{
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
type Tag = T::Tag;
|
|
758
|
+
|
|
759
|
+
// SAFETY: `<T as SizeEq<ReadOnly<T>>>::CastFrom` is a no-op projection that
|
|
760
|
+
// produces a pointer with the same referent. By invariant, for any `Ptr<'_,
|
|
761
|
+
// T, I>` it is sound to use `T::ProjectToTag` to project to a `Ptr<'_,
|
|
762
|
+
// T::Tag, I>`. Since `ReadOnly<T>` has the same layout and validity as `T`,
|
|
763
|
+
// the same is true of projecting from a `Ptr<'_, ReadOnly<T>, I>`.
|
|
764
|
+
type ProjectToTag = crate::pointer::cast::TransitiveProject<
|
|
765
|
+
T,
|
|
766
|
+
<T as SizeEq<ReadOnly<T>>>::CastFrom,
|
|
767
|
+
T::ProjectToTag,
|
|
768
|
+
>;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
// SAFETY: `ReadOnly<T>` is a `#[repr(transparent)]` wrapper around `T`, and so
|
|
772
|
+
// has the same fields at the same offsets. Thus, it satisfies the safety
|
|
773
|
+
// invariants of `HasField<Field, VARIANT_ID, FIELD_ID>` for field `f` exactly
|
|
774
|
+
// when `T` does, as guaranteed by the `T: HasField` bound:
|
|
775
|
+
// - If `VARIANT_ID` is `STRUCT_VARIANT_ID` or `UNION_VARIANT_ID`, then `T` has
|
|
776
|
+
// the layout of a struct or union type. Since `ReadOnly<T>` is a transparent
|
|
777
|
+
// wrapper around `T`, it does too. Otherwise, if `VARIANT_ID` is an enum
|
|
778
|
+
// variant index, then `T` has the layout of an enum type, and `ReadOnly<T>`
|
|
779
|
+
// does too.
|
|
780
|
+
// - By `T: HasField<_, _, FIELD_ID>`:
|
|
781
|
+
// - `T` has a field `f` with name `n` such that
|
|
782
|
+
// `FIELD_ID = zerocopy::ident_id!(n)` or at index `i` such that
|
|
783
|
+
// `FIELD_ID = zerocopy::ident_id!(i)`.
|
|
784
|
+
// - `Field` has the same visibility as `f`.
|
|
785
|
+
// - `T::Type` has the same type as `f`. Thus, `ReadOnly<T::Type>` has the
|
|
786
|
+
// same type as `f`, wrapped in `ReadOnly`.
|
|
787
|
+
//
|
|
788
|
+
// `project` satisfies its post-condition – namely, that the returned pointer
|
|
789
|
+
// refers to a non-strict subset of the bytes of `slf`'s referent, and has the
|
|
790
|
+
// same provenance as `slf` – because all intermediate operations satisfy those
|
|
791
|
+
// same conditions.
|
|
792
|
+
unsafe impl<T, Field, const VARIANT_ID: i128, const FIELD_ID: i128>
|
|
793
|
+
HasField<Field, VARIANT_ID, FIELD_ID> for ReadOnly<T>
|
|
794
|
+
where
|
|
795
|
+
T: HasField<Field, VARIANT_ID, FIELD_ID> + ?Sized,
|
|
796
|
+
{
|
|
797
|
+
#[allow(clippy::missing_inline_in_public_items)]
|
|
798
|
+
fn only_derive_is_allowed_to_implement_this_trait()
|
|
799
|
+
where
|
|
800
|
+
Self: Sized,
|
|
801
|
+
{
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
type Type = ReadOnly<T::Type>;
|
|
805
|
+
|
|
806
|
+
#[inline(always)]
|
|
807
|
+
fn project(slf: PtrInner<'_, Self>) -> *mut ReadOnly<T::Type> {
|
|
808
|
+
slf.project::<_, <T as SizeEq<ReadOnly<T>>>::CastFrom>()
|
|
809
|
+
.project::<_, crate::pointer::cast::Projection<Field, VARIANT_ID, FIELD_ID>>()
|
|
810
|
+
.project::<_, <ReadOnly<T::Type> as SizeEq<T::Type>>::CastFrom>()
|
|
811
|
+
.as_non_null()
|
|
812
|
+
.as_ptr()
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
// SAFETY: `ReadOnly<T>` is a `#[repr(transparent)]` wrapper around `T`, and so
|
|
817
|
+
// has the same fields at the same offsets. `is_projectable` simply delegates to
|
|
818
|
+
// `T::is_projectable`, which is sound because a `Ptr<'_, ReadOnly<T>, I>` will
|
|
819
|
+
// be projectable exactly when a `Ptr<'_, T, I>` referent is.
|
|
820
|
+
unsafe impl<T, Field, I, const VARIANT_ID: i128, const FIELD_ID: i128>
|
|
821
|
+
ProjectField<Field, I, VARIANT_ID, FIELD_ID> for ReadOnly<T>
|
|
822
|
+
where
|
|
823
|
+
T: ProjectField<Field, I, VARIANT_ID, FIELD_ID> + ?Sized,
|
|
824
|
+
I: invariant::Invariants,
|
|
825
|
+
{
|
|
826
|
+
#[allow(clippy::missing_inline_in_public_items)]
|
|
827
|
+
fn only_derive_is_allowed_to_implement_this_trait()
|
|
828
|
+
where
|
|
829
|
+
Self: Sized,
|
|
830
|
+
{
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
type Invariants = T::Invariants;
|
|
834
|
+
|
|
835
|
+
type Error = T::Error;
|
|
836
|
+
|
|
837
|
+
#[inline(always)]
|
|
838
|
+
fn is_projectable<'a>(ptr: Ptr<'a, Self::Tag, I>) -> Result<(), Self::Error> {
|
|
839
|
+
T::is_projectable(ptr)
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
|
|
597
843
|
#[cfg(test)]
|
|
598
844
|
mod tests {
|
|
599
845
|
use core::panic::AssertUnwindSafe;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Copyright 2026 The Fuchsia Authors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
|
|
4
|
+
// <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
|
|
5
|
+
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
|
|
6
|
+
// This file may not be copied, modified, or distributed except according to
|
|
7
|
+
// those terms.
|
|
8
|
+
|
|
9
|
+
extern crate zerocopy;
|
|
10
|
+
|
|
11
|
+
#[allow(unused)]
|
|
12
|
+
#[cfg(feature = "derive")]
|
|
13
|
+
mod util {
|
|
14
|
+
/// A type that doesn't implement any zerocopy traits.
|
|
15
|
+
pub struct NotZerocopy<T = ()>(pub T);
|
|
16
|
+
|
|
17
|
+
/// A `u16` with alignment 2.
|
|
18
|
+
///
|
|
19
|
+
/// Though `u16` has alignment 2 on some platforms, it's not guaranteed. By
|
|
20
|
+
/// contrast, `util::AU16` is guaranteed to have alignment 2.
|
|
21
|
+
#[derive(
|
|
22
|
+
zerocopy::KnownLayout,
|
|
23
|
+
zerocopy::Immutable,
|
|
24
|
+
zerocopy::FromBytes,
|
|
25
|
+
zerocopy::IntoBytes,
|
|
26
|
+
Copy,
|
|
27
|
+
Clone,
|
|
28
|
+
)]
|
|
29
|
+
#[repr(C, align(2))]
|
|
30
|
+
pub struct AU16(pub u16);
|
|
31
|
+
|
|
32
|
+
// Since we can't import these by path (ie, `util::assert_impl_all!`), use a
|
|
33
|
+
// name prefix to ensure our derive-emitted code isn't accidentally relying
|
|
34
|
+
// on `assert_impl_all!` being in scope.
|
|
35
|
+
#[macro_export]
|
|
36
|
+
macro_rules! util_assert_impl_all {
|
|
37
|
+
($type:ty: $($trait:path),+ $(,)?) => {
|
|
38
|
+
const _: fn() = || {
|
|
39
|
+
use ::core::prelude::v1::*;
|
|
40
|
+
::static_assertions::assert_impl_all!($type: $($trait),+);
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Since we can't import these by path (ie, `util::assert_not_impl_any!`),
|
|
46
|
+
// use a name prefix to ensure our derive-emitted code isn't accidentally
|
|
47
|
+
// relying on `assert_not_impl_any!` being in scope.
|
|
48
|
+
#[macro_export]
|
|
49
|
+
macro_rules! util_assert_not_impl_any {
|
|
50
|
+
($x:ty: $($t:path),+ $(,)?) => {
|
|
51
|
+
const _: fn() = || {
|
|
52
|
+
use ::core::prelude::v1::*;
|
|
53
|
+
::static_assertions::assert_not_impl_any!($x: $($t),+);
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#[macro_export]
|
|
59
|
+
macro_rules! test_trivial_is_bit_valid {
|
|
60
|
+
($x:ty => $name:ident) => {
|
|
61
|
+
#[test]
|
|
62
|
+
fn $name() {
|
|
63
|
+
util::test_trivial_is_bit_valid::<$x>();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
// This file may not be copied, modified, or distributed except according to
|
|
7
7
|
// those terms.
|
|
8
8
|
|
|
9
|
-
include!("
|
|
10
|
-
|
|
11
|
-
extern crate zerocopy;
|
|
9
|
+
include!("../include.rs");
|
|
12
10
|
|
|
13
11
|
use util::NotZerocopy;
|
|
14
12
|
use zerocopy::FromBytes;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
error[E0277]: the trait bound `NotZerocopy:
|
|
2
|
-
--> tests/ui-msrv/diagnostic-not-implemented-from-bytes.rs:
|
|
1
|
+
error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied
|
|
2
|
+
--> tests/ui-msrv/diagnostic-not-implemented-from-bytes.rs:16:24
|
|
3
3
|
|
|
|
4
|
-
|
|
5
|
-
| ^^^^^^^^^^^ the trait `
|
|
4
|
+
16 | takes_from_bytes::<NotZerocopy>();
|
|
5
|
+
| ^^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy`
|
|
6
6
|
|
|
|
7
7
|
note: required by a bound in `takes_from_bytes`
|
|
8
|
-
--> tests/ui-msrv/diagnostic-not-implemented-from-bytes.rs:
|
|
8
|
+
--> tests/ui-msrv/diagnostic-not-implemented-from-bytes.rs:19:24
|
|
9
9
|
|
|
|
10
|
-
|
|
10
|
+
19 | fn takes_from_bytes<T: FromBytes>() {}
|
|
11
11
|
| ^^^^^^^^^ required by this bound in `takes_from_bytes`
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
// This file may not be copied, modified, or distributed except according to
|
|
7
7
|
// those terms.
|
|
8
8
|
|
|
9
|
-
include!("
|
|
10
|
-
|
|
11
|
-
extern crate zerocopy;
|
|
9
|
+
include!("../include.rs");
|
|
12
10
|
|
|
13
11
|
use util::NotZerocopy;
|
|
14
12
|
use zerocopy::FromZeros;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
error[E0277]: the trait bound `NotZerocopy: FromZeros` is not satisfied
|
|
2
|
-
--> tests/ui-msrv/diagnostic-not-implemented-from-zeros.rs:
|
|
2
|
+
--> tests/ui-msrv/diagnostic-not-implemented-from-zeros.rs:16:24
|
|
3
3
|
|
|
|
4
|
-
|
|
4
|
+
16 | takes_from_zeros::<NotZerocopy>();
|
|
5
5
|
| ^^^^^^^^^^^ the trait `FromZeros` is not implemented for `NotZerocopy`
|
|
6
6
|
|
|
|
7
7
|
note: required by a bound in `takes_from_zeros`
|
|
8
|
-
--> tests/ui-msrv/diagnostic-not-implemented-from-zeros.rs:
|
|
8
|
+
--> tests/ui-msrv/diagnostic-not-implemented-from-zeros.rs:19:24
|
|
9
9
|
|
|
|
10
|
-
|
|
10
|
+
19 | fn takes_from_zeros<T: FromZeros>() {}
|
|
11
11
|
| ^^^^^^^^^ required by this bound in `takes_from_zeros`
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
// This file may not be copied, modified, or distributed except according to
|
|
7
7
|
// those terms.
|
|
8
8
|
|
|
9
|
-
include!("
|
|
10
|
-
|
|
11
|
-
extern crate zerocopy;
|
|
9
|
+
include!("../include.rs");
|
|
12
10
|
|
|
13
11
|
use util::NotZerocopy;
|
|
14
12
|
use zerocopy::Immutable;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
error[E0277]: the trait bound `NotZerocopy:
|
|
2
|
-
--> tests/ui-msrv/diagnostic-not-implemented-immutable.rs:
|
|
1
|
+
error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied
|
|
2
|
+
--> tests/ui-msrv/diagnostic-not-implemented-immutable.rs:16:23
|
|
3
3
|
|
|
|
4
|
-
|
|
5
|
-
| ^^^^^^^^^^^ the trait `
|
|
4
|
+
16 | takes_immutable::<NotZerocopy>();
|
|
5
|
+
| ^^^^^^^^^^^ the trait `Immutable` is not implemented for `NotZerocopy`
|
|
6
6
|
|
|
|
7
7
|
note: required by a bound in `takes_immutable`
|
|
8
|
-
--> tests/ui-msrv/diagnostic-not-implemented-immutable.rs:
|
|
8
|
+
--> tests/ui-msrv/diagnostic-not-implemented-immutable.rs:19:23
|
|
9
9
|
|
|
|
10
|
-
|
|
10
|
+
19 | fn takes_immutable<T: Immutable>() {}
|
|
11
11
|
| ^^^^^^^^^ required by this bound in `takes_immutable`
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
// This file may not be copied, modified, or distributed except according to
|
|
7
7
|
// those terms.
|
|
8
8
|
|
|
9
|
-
include!("
|
|
10
|
-
|
|
11
|
-
extern crate zerocopy;
|
|
9
|
+
include!("../include.rs");
|
|
12
10
|
|
|
13
11
|
use util::NotZerocopy;
|
|
14
12
|
use zerocopy::IntoBytes;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
error[E0277]: the trait bound `NotZerocopy:
|
|
2
|
-
--> tests/ui-msrv/diagnostic-not-implemented-into-bytes.rs:
|
|
1
|
+
error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied
|
|
2
|
+
--> tests/ui-msrv/diagnostic-not-implemented-into-bytes.rs:16:24
|
|
3
3
|
|
|
|
4
|
-
|
|
5
|
-
| ^^^^^^^^^^^ the trait `
|
|
4
|
+
16 | takes_into_bytes::<NotZerocopy>();
|
|
5
|
+
| ^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `NotZerocopy`
|
|
6
6
|
|
|
|
7
7
|
note: required by a bound in `takes_into_bytes`
|
|
8
|
-
--> tests/ui-msrv/diagnostic-not-implemented-into-bytes.rs:
|
|
8
|
+
--> tests/ui-msrv/diagnostic-not-implemented-into-bytes.rs:19:24
|
|
9
9
|
|
|
|
10
|
-
|
|
10
|
+
19 | fn takes_into_bytes<T: IntoBytes>() {}
|
|
11
11
|
| ^^^^^^^^^ required by this bound in `takes_into_bytes`
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
// This file may not be copied, modified, or distributed except according to
|
|
7
7
|
// those terms.
|
|
8
8
|
|
|
9
|
-
include!("
|
|
10
|
-
|
|
11
|
-
extern crate zerocopy;
|
|
9
|
+
include!("../include.rs");
|
|
12
10
|
|
|
13
11
|
use util::NotZerocopy;
|
|
14
12
|
use zerocopy::{Immutable, IntoBytes};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
error[E0277]: the trait bound `NotZerocopy:
|
|
2
|
-
--> tests/ui-msrv/diagnostic-not-implemented-issue-1296.rs:
|
|
1
|
+
error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied
|
|
2
|
+
--> tests/ui-msrv/diagnostic-not-implemented-issue-1296.rs:50:19
|
|
3
3
|
|
|
|
4
|
-
|
|
5
|
-
| ^^^^^^^^^^^^^^^ the trait `
|
|
4
|
+
50 | Foo.write_obj(NotZerocopy(()));
|
|
5
|
+
| ^^^^^^^^^^^^^^^ the trait `Immutable` is not implemented for `NotZerocopy`
|
|
6
6
|
|
|
7
|
-
error[E0277]: the trait bound `NotZerocopy:
|
|
8
|
-
--> tests/ui-msrv/diagnostic-not-implemented-issue-1296.rs:
|
|
7
|
+
error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied
|
|
8
|
+
--> tests/ui-msrv/diagnostic-not-implemented-issue-1296.rs:50:19
|
|
9
9
|
|
|
|
10
|
-
|
|
11
|
-
| ^^^^^^^^^^^^^^^ the trait `
|
|
10
|
+
50 | Foo.write_obj(NotZerocopy(()));
|
|
11
|
+
| ^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `NotZerocopy`
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
// This file may not be copied, modified, or distributed except according to
|
|
7
7
|
// those terms.
|
|
8
8
|
|
|
9
|
-
include!("
|
|
10
|
-
|
|
11
|
-
extern crate zerocopy;
|
|
9
|
+
include!("../include.rs");
|
|
12
10
|
|
|
13
11
|
use util::NotZerocopy;
|
|
14
12
|
use zerocopy::KnownLayout;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
error[E0277]: the trait bound `NotZerocopy:
|
|
2
|
-
--> tests/ui-msrv/diagnostic-not-implemented-known-layout.rs:
|
|
1
|
+
error[E0277]: the trait bound `NotZerocopy: KnownLayout` is not satisfied
|
|
2
|
+
--> tests/ui-msrv/diagnostic-not-implemented-known-layout.rs:16:26
|
|
3
3
|
|
|
|
4
|
-
|
|
5
|
-
| ^^^^^^^^^^^ the trait `
|
|
4
|
+
16 | takes_known_layout::<NotZerocopy>();
|
|
5
|
+
| ^^^^^^^^^^^ the trait `KnownLayout` is not implemented for `NotZerocopy`
|
|
6
6
|
|
|
|
7
7
|
note: required by a bound in `takes_known_layout`
|
|
8
|
-
--> tests/ui-msrv/diagnostic-not-implemented-known-layout.rs:
|
|
8
|
+
--> tests/ui-msrv/diagnostic-not-implemented-known-layout.rs:19:26
|
|
9
9
|
|
|
|
10
|
-
|
|
10
|
+
19 | fn takes_known_layout<T: KnownLayout>() {}
|
|
11
11
|
| ^^^^^^^^^^^ required by this bound in `takes_known_layout`
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
// This file may not be copied, modified, or distributed except according to
|
|
7
7
|
// those terms.
|
|
8
8
|
|
|
9
|
-
include!("
|
|
10
|
-
|
|
11
|
-
extern crate zerocopy;
|
|
9
|
+
include!("../include.rs");
|
|
12
10
|
|
|
13
11
|
use util::NotZerocopy;
|
|
14
12
|
use zerocopy::TryFromBytes;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
error[E0277]: the trait bound `NotZerocopy:
|
|
2
|
-
--> tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.rs:
|
|
1
|
+
error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
|
|
2
|
+
--> tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.rs:16:28
|
|
3
3
|
|
|
|
4
|
-
|
|
5
|
-
| ^^^^^^^^^^^ the trait `
|
|
4
|
+
16 | takes_try_from_bytes::<NotZerocopy>();
|
|
5
|
+
| ^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy`
|
|
6
6
|
|
|
|
7
7
|
note: required by a bound in `takes_try_from_bytes`
|
|
8
|
-
--> tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.rs:
|
|
8
|
+
--> tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.rs:19:28
|
|
9
9
|
|
|
|
10
|
-
|
|
10
|
+
19 | fn takes_try_from_bytes<T: TryFromBytes>() {}
|
|
11
11
|
| ^^^^^^^^^^^^ required by this bound in `takes_try_from_bytes`
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
// This file may not be copied, modified, or distributed except according to
|
|
7
7
|
// those terms.
|
|
8
8
|
|
|
9
|
-
include!("
|
|
10
|
-
|
|
11
|
-
extern crate zerocopy;
|
|
9
|
+
include!("../include.rs");
|
|
12
10
|
|
|
13
11
|
use util::NotZerocopy;
|
|
14
12
|
use zerocopy::Unaligned;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
error[E0277]: the trait bound `NotZerocopy: zerocopy::Unaligned` is not satisfied
|
|
2
|
-
--> tests/ui-msrv/diagnostic-not-implemented-unaligned.rs:
|
|
2
|
+
--> tests/ui-msrv/diagnostic-not-implemented-unaligned.rs:16:23
|
|
3
3
|
|
|
|
4
|
-
|
|
4
|
+
16 | takes_unaligned::<NotZerocopy>();
|
|
5
5
|
| ^^^^^^^^^^^ the trait `zerocopy::Unaligned` is not implemented for `NotZerocopy`
|
|
6
6
|
|
|
|
7
7
|
note: required by a bound in `takes_unaligned`
|
|
8
|
-
--> tests/ui-msrv/diagnostic-not-implemented-unaligned.rs:
|
|
8
|
+
--> tests/ui-msrv/diagnostic-not-implemented-unaligned.rs:19:23
|
|
9
9
|
|
|
|
10
|
-
|
|
10
|
+
19 | fn takes_unaligned<T: Unaligned>() {}
|
|
11
11
|
| ^^^^^^^^^ required by this bound in `takes_unaligned`
|
|
@@ -6,14 +6,12 @@
|
|
|
6
6
|
// This file may not be copied, modified, or distributed except according to
|
|
7
7
|
// those terms.
|
|
8
8
|
|
|
9
|
-
include!("
|
|
10
|
-
|
|
11
|
-
#[macro_use]
|
|
12
|
-
extern crate zerocopy;
|
|
9
|
+
include!("../include.rs");
|
|
13
10
|
|
|
14
11
|
use util::NotZerocopy;
|
|
15
12
|
|
|
16
13
|
fn main() {}
|
|
17
14
|
|
|
18
15
|
// Should fail because `NotZerocopy<u32>: !FromBytes`.
|
|
19
|
-
const NOT_FROM_BYTES: NotZerocopy<u32> =
|
|
16
|
+
const NOT_FROM_BYTES: NotZerocopy<u32> =
|
|
17
|
+
zerocopy::include_value!("../../testdata/include_value/data");
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
error[E0277]: the trait bound `NotZerocopy<u32>:
|
|
2
|
-
--> tests/ui-msrv/include_value_not_from_bytes.rs:
|
|
1
|
+
error[E0277]: the trait bound `NotZerocopy<u32>: FromBytes` is not satisfied
|
|
2
|
+
--> tests/ui-msrv/include_value_not_from_bytes.rs:17:5
|
|
3
3
|
|
|
|
4
|
-
|
|
5
|
-
|
|
|
4
|
+
17 | zerocopy::include_value!("../../testdata/include_value/data");
|
|
5
|
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy<u32>`
|
|
6
6
|
|
|
|
7
7
|
note: required by a bound in `NOT_FROM_BYTES::transmute`
|
|
8
|
-
--> tests/ui-msrv/include_value_not_from_bytes.rs:
|
|
8
|
+
--> tests/ui-msrv/include_value_not_from_bytes.rs:17:5
|
|
9
9
|
|
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
10
|
+
17 | zerocopy::include_value!("../../testdata/include_value/data");
|
|
11
|
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
12
|
+
| |
|
|
13
|
+
| required by a bound in this
|
|
14
|
+
| required by this bound in `NOT_FROM_BYTES::transmute`
|
|
15
15
|
= note: this error originates in the macro `$crate::transmute` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
@@ -6,10 +6,7 @@
|
|
|
6
6
|
// This file may not be copied, modified, or distributed except according to
|
|
7
7
|
// those terms.
|
|
8
8
|
|
|
9
|
-
#[macro_use]
|
|
10
|
-
extern crate zerocopy;
|
|
11
|
-
|
|
12
9
|
fn main() {}
|
|
13
10
|
|
|
14
11
|
// Should fail because the file is 4 bytes long, not 8.
|
|
15
|
-
const WRONG_SIZE: u64 = include_value!("../../testdata/include_value/data");
|
|
12
|
+
const WRONG_SIZE: u64 = zerocopy::include_value!("../../testdata/include_value/data");
|