html-to-markdown 2.24.1 → 2.24.3

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.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +9 -6
  3. data/ext/html-to-markdown-rb/native/Cargo.lock +13 -13
  4. data/ext/html-to-markdown-rb/native/Cargo.toml +1 -1
  5. data/lib/html_to_markdown/version.rb +1 -1
  6. data/rust-vendor/bytemuck/.cargo-checksum.json +1 -1
  7. data/rust-vendor/bytemuck/.cargo_vcs_info.json +1 -1
  8. data/rust-vendor/bytemuck/.github/workflows/rust.yml +4 -4
  9. data/rust-vendor/bytemuck/Cargo.lock +16 -9
  10. data/rust-vendor/bytemuck/Cargo.toml +6 -2
  11. data/rust-vendor/bytemuck/Cargo.toml.orig +7 -6
  12. data/rust-vendor/bytemuck/changelog.md +5 -0
  13. data/rust-vendor/bytemuck/src/must.rs +1 -1
  14. data/rust-vendor/bytemuck/src/pod.rs +13 -0
  15. data/rust-vendor/bytemuck/src/zeroable.rs +13 -0
  16. data/rust-vendor/bytemuck/src/zeroable_in_option.rs +2 -2
  17. data/rust-vendor/bytemuck/tests/std_tests.rs +1 -1
  18. data/rust-vendor/cc/.cargo-checksum.json +1 -1
  19. data/rust-vendor/cc/.cargo_vcs_info.json +1 -1
  20. data/rust-vendor/cc/CHANGELOG.md +8 -0
  21. data/rust-vendor/cc/Cargo.lock +3 -3
  22. data/rust-vendor/cc/Cargo.toml +2 -2
  23. data/rust-vendor/cc/Cargo.toml.orig +2 -2
  24. data/rust-vendor/cc/src/lib.rs +1 -0
  25. data/rust-vendor/cc/src/target/generated.rs +10 -0
  26. data/rust-vendor/find-msvc-tools/.cargo-checksum.json +1 -1
  27. data/rust-vendor/find-msvc-tools/.cargo_vcs_info.json +1 -1
  28. data/rust-vendor/find-msvc-tools/CHANGELOG.md +6 -0
  29. data/rust-vendor/find-msvc-tools/Cargo.lock +1 -1
  30. data/rust-vendor/find-msvc-tools/Cargo.toml +1 -1
  31. data/rust-vendor/find-msvc-tools/Cargo.toml.orig +1 -1
  32. data/rust-vendor/find-msvc-tools/src/find_tools.rs +55 -20
  33. data/rust-vendor/html-to-markdown-rs/src/converter/handlers/link.rs +1 -9
  34. data/rust-vendor/html-to-markdown-rs/src/converter/inline/link.rs +2 -11
  35. data/rust-vendor/html-to-markdown-rs/src/converter/list/definition.rs +30 -7
  36. data/rust-vendor/html-to-markdown-rs/src/converter/semantic/definition_list.rs +30 -7
  37. data/rust-vendor/html-to-markdown-rs/tests/issue_199_regressions.rs +15 -0
  38. data/rust-vendor/html-to-markdown-rs/tests/issue_200_regressions.rs +36 -0
  39. data/rust-vendor/zerocopy/.cargo-checksum.json +1 -1
  40. data/rust-vendor/zerocopy/.cargo_vcs_info.json +2 -1
  41. data/rust-vendor/zerocopy/Cargo.lock +3 -3
  42. data/rust-vendor/zerocopy/Cargo.toml +4 -4
  43. data/rust-vendor/zerocopy/Cargo.toml.orig +4 -4
  44. data/rust-vendor/zerocopy/src/doctests.rs +27 -0
  45. data/rust-vendor/zerocopy/src/error.rs +30 -0
  46. data/rust-vendor/zerocopy/src/layout.rs +239 -135
  47. data/rust-vendor/zerocopy/src/lib.rs +16 -0
  48. data/rust-vendor/zerocopy/src/macros.rs +255 -125
  49. data/rust-vendor/zerocopy/src/pointer/mod.rs +1 -1
  50. data/rust-vendor/zerocopy/src/pointer/ptr.rs +109 -23
  51. data/rust-vendor/zerocopy/src/util/macro_util.rs +344 -383
  52. data/rust-vendor/zerocopy/src/util/mod.rs +38 -0
  53. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-const.stderr +8 -0
  54. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-a-reference.stderr +10 -0
  55. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-unsized.stderr +11 -3
  56. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-mutable.stderr +10 -0
  57. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-a-reference.stderr +10 -0
  58. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-dst-not-references.stderr +10 -0
  59. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-unsized.stderr +11 -3
  60. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.stderr +0 -10
  61. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-mutable.stderr +1 -1
  62. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +0 -10
  63. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.stderr +1 -11
  64. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-const.stderr +9 -0
  65. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-a-reference.stderr +10 -0
  66. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-unsized.stderr +16 -8
  67. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-mutable.stderr +10 -0
  68. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-a-reference.stderr +10 -0
  69. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-dst-not-references.stderr +10 -0
  70. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-unsized.stderr +16 -8
  71. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.stderr +38 -38
  72. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +33 -33
  73. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.stderr +12 -12
  74. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-const.stderr +9 -0
  75. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-a-reference.stderr +10 -0
  76. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-unsized.stderr +16 -8
  77. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-mutable.stderr +10 -0
  78. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-a-reference.stderr +10 -0
  79. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-dst-not-references.stderr +10 -0
  80. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-unsized.stderr +16 -8
  81. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.stderr +38 -38
  82. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +33 -33
  83. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.stderr +12 -12
  84. data/rust-vendor/zerocopy-derive/.cargo-checksum.json +1 -1
  85. data/rust-vendor/zerocopy-derive/.cargo_vcs_info.json +1 -1
  86. data/rust-vendor/zerocopy-derive/Cargo.lock +1 -1
  87. data/rust-vendor/zerocopy-derive/Cargo.toml +1 -1
  88. data/rust-vendor/zerocopy-derive/Cargo.toml.orig +1 -1
  89. data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum.stderr +3 -3
  90. data/rust-vendor/zerocopy-derive/tests/ui-nightly/struct.stderr +5 -5
  91. data/rust-vendor/zerocopy-derive/tests/ui-stable/enum.stderr +3 -3
  92. data/rust-vendor/zerocopy-derive/tests/ui-stable/struct.stderr +5 -5
  93. data/rust-vendor/zmij/.cargo-checksum.json +1 -1
  94. data/rust-vendor/zmij/.cargo_vcs_info.json +1 -1
  95. data/rust-vendor/zmij/Cargo.lock +16 -16
  96. data/rust-vendor/zmij/Cargo.toml +1 -1
  97. data/rust-vendor/zmij/Cargo.toml.orig +1 -1
  98. data/rust-vendor/zmij/README.md +1 -1
  99. data/rust-vendor/zmij/src/lib.rs +54 -93
  100. metadata +4 -50
  101. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-unsized.rs +0 -15
  102. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-unsized.stderr +0 -8
  103. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-unsized.rs +0 -15
  104. data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-unsized.stderr +0 -8
  105. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-alignment-increase.rs +0 -19
  106. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-alignment-increase.stderr +0 -9
  107. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-decrease.rs +0 -19
  108. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-decrease.stderr +0 -9
  109. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-increase.rs +0 -19
  110. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-size-increase.stderr +0 -17
  111. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-alignment-increase.rs +0 -18
  112. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-alignment-increase.stderr +0 -9
  113. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-decrease.rs +0 -18
  114. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-decrease.stderr +0 -9
  115. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-increase.rs +0 -18
  116. data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-size-increase.stderr +0 -9
  117. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-unsized.rs +0 -15
  118. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-unsized.stderr +0 -16
  119. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-unsized.rs +0 -15
  120. data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-unsized.stderr +0 -16
  121. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-alignment-increase.rs +0 -19
  122. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-alignment-increase.stderr +0 -9
  123. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-decrease.rs +0 -19
  124. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-decrease.stderr +0 -9
  125. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-increase.rs +0 -19
  126. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-size-increase.stderr +0 -17
  127. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-alignment-increase.rs +0 -18
  128. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-alignment-increase.stderr +0 -9
  129. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-decrease.rs +0 -18
  130. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-decrease.stderr +0 -9
  131. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-increase.rs +0 -18
  132. data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-size-increase.stderr +0 -9
  133. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-unsized.rs +0 -15
  134. data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-unsized.stderr +0 -16
  135. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-unsized.rs +0 -15
  136. data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-unsized.stderr +0 -16
  137. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-alignment-increase.rs +0 -19
  138. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-alignment-increase.stderr +0 -9
  139. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-decrease.rs +0 -19
  140. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-decrease.stderr +0 -9
  141. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-increase.rs +0 -19
  142. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-size-increase.stderr +0 -17
  143. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-alignment-increase.rs +0 -18
  144. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-alignment-increase.stderr +0 -9
  145. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-decrease.rs +0 -18
  146. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-decrease.stderr +0 -9
  147. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-increase.rs +0 -18
  148. data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-size-increase.stderr +0 -9
@@ -20,6 +20,10 @@ use core::{
20
20
  };
21
21
 
22
22
  use super::*;
23
+ use crate::pointer::{
24
+ invariant::{Exclusive, Shared, Valid},
25
+ SizeEq, TransmuteFromPtr,
26
+ };
23
27
 
24
28
  /// Like [`PhantomData`], but [`Send`] and [`Sync`] regardless of whether the
25
29
  /// wrapped `T` is.
@@ -321,6 +325,40 @@ pub(crate) const unsafe fn transmute_unchecked<Src, Dst>(src: Src) -> Dst {
321
325
  unsafe { ManuallyDrop::into_inner(Transmute { src: ManuallyDrop::new(src) }.dst) }
322
326
  }
323
327
 
328
+ /// # Safety
329
+ ///
330
+ /// `Src` must have a greater or equal alignment to `Dst`.
331
+ pub(crate) unsafe fn transmute_ref<Src, Dst, R>(src: &Src) -> &Dst
332
+ where
333
+ Src: ?Sized,
334
+ Dst: SizeEq<Src>
335
+ + TransmuteFromPtr<Src, Shared, Valid, Valid, <Dst as SizeEq<Src>>::CastFrom, R>
336
+ + ?Sized,
337
+ {
338
+ let dst = Ptr::from_ref(src).transmute();
339
+ // SAFETY: The caller promises that `Src`'s alignment is at least as large
340
+ // as `Dst`'s alignment.
341
+ let dst = unsafe { dst.assume_alignment() };
342
+ dst.as_ref()
343
+ }
344
+
345
+ /// # Safety
346
+ ///
347
+ /// `Src` must have a greater or equal alignment to `Dst`.
348
+ pub(crate) unsafe fn transmute_mut<Src, Dst, R>(src: &mut Src) -> &mut Dst
349
+ where
350
+ Src: ?Sized,
351
+ Dst: SizeEq<Src>
352
+ + TransmuteFromPtr<Src, Exclusive, Valid, Valid, <Dst as SizeEq<Src>>::CastFrom, R>
353
+ + ?Sized,
354
+ {
355
+ let dst = Ptr::from_mut(src).transmute();
356
+ // SAFETY: The caller promises that `Src`'s alignment is at least as large
357
+ // as `Dst`'s alignment.
358
+ let dst = unsafe { dst.assume_alignment() };
359
+ dst.as_mut()
360
+ }
361
+
324
362
  /// Uses `allocate` to create a `Box<T>`.
325
363
  ///
326
364
  /// # Errors
@@ -29,6 +29,14 @@ error[E0015]: calls in constants are limited to constant functions, tuple struct
29
29
  |
30
30
  = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
31
31
 
32
+ error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
33
+ --> tests/ui-msrv/transmute-mut-const.rs:18:37
34
+ |
35
+ 18 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S);
36
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37
+ |
38
+ = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
39
+
32
40
  error[E0716]: temporary value dropped while borrowed
33
41
  --> tests/ui-msrv/transmute-mut-const.rs:18:57
34
42
  |
@@ -7,3 +7,13 @@ error[E0308]: mismatched types
7
7
  = note: expected type `usize`
8
8
  found mutable reference `&mut _`
9
9
  = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
10
+
11
+ error[E0308]: mismatched types
12
+ --> tests/ui-msrv/transmute-mut-dst-not-a-reference.rs:15:36
13
+ |
14
+ 15 | const DST_NOT_A_REFERENCE: usize = transmute_mut!(&mut 0u8);
15
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&mut _`
16
+ |
17
+ = note: expected type `usize`
18
+ found mutable reference `&mut _`
19
+ = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,8 +1,16 @@
1
- error[E0271]: type mismatch resolving `<[u8; 1] as KnownLayout>::PointerMetadata == usize`
1
+ error[E0599]: the method `transmute_mut` exists for struct `Wrap<&mut [u8], &mut [u8; 1]>`, but its trait bounds were not satisfied
2
2
  --> tests/ui-msrv/transmute-mut-src-unsized.rs:15:35
3
3
  |
4
4
  15 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]);
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize`
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `Wrap<&mut [u8], &mut [u8; 1]>` due to unsatisfied trait bounds
6
6
  |
7
- = note: required because of the requirements on the impl of `TransmuteMutDst<'_>` for `Wrap<&mut [u8], &mut [u8; 1]>`
7
+ ::: src/util/macro_util.rs
8
+ |
9
+ | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
10
+ | --------------------------------------------------------- doesn't satisfy `Wrap<&mut [u8], &mut [u8; 1]>: TransmuteMutDst`
11
+ |
12
+ = note: the following trait bounds were not satisfied:
13
+ `[u8]: Sized`
14
+ `<[u8; 1] as KnownLayout>::PointerMetadata = usize`
15
+ which is required by `Wrap<&mut [u8], &mut [u8; 1]>: TransmuteMutDst`
8
16
  = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -27,3 +27,13 @@ error[E0308]: mismatched types
27
27
  = note: expected mutable reference `&mut u8`
28
28
  found reference `&_`
29
29
  = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
30
+
31
+ error[E0308]: mismatched types
32
+ --> tests/ui-msrv/transmute-ref-dst-mutable.rs:16:22
33
+ |
34
+ 16 | let _: &mut u8 = transmute_ref!(&0u8);
35
+ | ^^^^^^^^^^^^^^^^^^^^ types differ in mutability
36
+ |
37
+ = note: expected mutable reference `&mut u8`
38
+ found reference `&_`
39
+ = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -27,3 +27,13 @@ error[E0308]: mismatched types
27
27
  = note: expected type `usize`
28
28
  found reference `&_`
29
29
  = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
30
+
31
+ error[E0308]: mismatched types
32
+ --> tests/ui-msrv/transmute-ref-dst-not-a-reference.rs:15:36
33
+ |
34
+ 15 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8);
35
+ | ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found reference
36
+ |
37
+ = note: expected type `usize`
38
+ found reference `&_`
39
+ = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -40,3 +40,13 @@ error[E0308]: mismatched types
40
40
  = note: expected type `usize`
41
41
  found reference `&_`
42
42
  = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
43
+
44
+ error[E0308]: mismatched types
45
+ --> tests/ui-msrv/transmute-ref-src-dst-not-references.rs:15:39
46
+ |
47
+ 15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize);
48
+ | ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found reference
49
+ |
50
+ = note: expected type `usize`
51
+ found reference `&_`
52
+ = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,8 +1,16 @@
1
- error[E0271]: type mismatch resolving `<[u8; 1] as KnownLayout>::PointerMetadata == usize`
1
+ error[E0599]: the method `transmute_ref` exists for struct `Wrap<&[u8], &[u8; 1]>`, but its trait bounds were not satisfied
2
2
  --> tests/ui-msrv/transmute-ref-src-unsized.rs:14:31
3
3
  |
4
4
  14 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]);
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize`
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `Wrap<&[u8], &[u8; 1]>` due to unsatisfied trait bounds
6
6
  |
7
- = note: required because of the requirements on the impl of `TransmuteRefDst<'_>` for `Wrap<&[u8], &[u8; 1]>`
7
+ ::: src/util/macro_util.rs
8
+ |
9
+ | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
10
+ | --------------------------------------------------------- doesn't satisfy `Wrap<&[u8], &[u8; 1]>: TransmuteRefDst`
11
+ |
12
+ = note: the following trait bounds were not satisfied:
13
+ `[u8]: Sized`
14
+ `<[u8; 1] as KnownLayout>::PointerMetadata = usize`
15
+ which is required by `Wrap<&[u8], &[u8; 1]>: TransmuteRefDst`
8
16
  = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -4,11 +4,6 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
4
4
  18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src);
5
5
  | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy`
6
6
  |
7
- note: required by a bound in `try_transmute_mut`
8
- --> src/util/macro_util.rs
9
- |
10
- | Dst: TryFromBytes + IntoBytes,
11
- | ^^^^^^^^^^^^ required by this bound in `try_transmute_mut`
12
7
  = note: this error originates in the macro `try_transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
13
8
 
14
9
  error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied
@@ -17,11 +12,6 @@ error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied
17
12
  18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src);
18
13
  | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `NotZerocopy`
19
14
  |
20
- note: required by a bound in `try_transmute_mut`
21
- --> src/util/macro_util.rs
22
- |
23
- | Dst: TryFromBytes + IntoBytes,
24
- | ^^^^^^^^^ required by this bound in `try_transmute_mut`
25
15
  = note: this error originates in the macro `try_transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
26
16
 
27
17
  error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
@@ -15,7 +15,7 @@ error[E0308]: mismatched types
15
15
  | ^^^^^^^^^^^^^^^^^^^^^^^^
16
16
  | |
17
17
  | types differ in mutability
18
- | help: try using a variant of the expected enum: `Err($crate::util::macro_util::try_transmute_ref::<_, _>(e))`
18
+ | help: try using a variant of the expected enum: `Err(t.try_transmute_ref())`
19
19
  |
20
20
  = note: expected enum `Result<&mut u8, _>`
21
21
  found enum `Result<&_, ValidityError<&u8, _>>`
@@ -4,11 +4,6 @@ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
4
4
  17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0));
5
5
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TryFromBytes` is not implemented for `NotZerocopy`
6
6
  |
7
- note: required by a bound in `try_transmute_ref`
8
- --> src/util/macro_util.rs
9
- |
10
- | Dst: TryFromBytes + Immutable,
11
- | ^^^^^^^^^^^^ required by this bound in `try_transmute_ref`
12
7
  = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
13
8
 
14
9
  error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied
@@ -17,11 +12,6 @@ error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied
17
12
  17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0));
18
13
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Immutable` is not implemented for `NotZerocopy`
19
14
  |
20
- note: required by a bound in `try_transmute_ref`
21
- --> src/util/macro_util.rs
22
- |
23
- | Dst: TryFromBytes + Immutable,
24
- | ^^^^^^^^^ required by this bound in `try_transmute_ref`
25
15
  = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
26
16
 
27
17
  error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
@@ -4,22 +4,12 @@ error[E0277]: the trait bound `NotZerocopy<AU16>: IntoBytes` is not satisfied
4
4
  17 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0)));
5
5
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoBytes` is not implemented for `NotZerocopy<AU16>`
6
6
  |
7
- note: required by a bound in `try_transmute_ref`
8
- --> src/util/macro_util.rs
9
- |
10
- | Src: IntoBytes + Immutable,
11
- | ^^^^^^^^^ required by this bound in `try_transmute_ref`
12
7
  = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
13
8
 
14
9
  error[E0277]: the trait bound `NotZerocopy<AU16>: Immutable` is not satisfied
15
10
  --> tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.rs:17:48
16
11
  |
17
12
  17 | let src_not_into_bytes: Result<&AU16, _> = try_transmute_ref!(&NotZerocopy(AU16(0)));
18
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an implementor of trait `Immutable`
19
- |
20
- note: required by a bound in `try_transmute_ref`
21
- --> src/util/macro_util.rs
13
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Immutable` is not implemented for `NotZerocopy<AU16>`
22
14
  |
23
- | Src: IntoBytes + Immutable,
24
- | ^^^^^^^^^ required by this bound in `try_transmute_ref`
25
15
  = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -13,6 +13,15 @@ note: `const` item defined here
13
13
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
14
  = note: `#[warn(const_item_mutation)]` on by default
15
15
 
16
+ error[E0015]: cannot call non-const method `zerocopy::util::macro_util::Wrap::<&mut [u8; 2], &mut [u8; 2]>::transmute_mut_inference_helper` in constants
17
+ --> tests/ui-nightly/transmute-mut-const.rs:18:37
18
+ |
19
+ 18 | const CONST_CONTEXT: &mut [u8; 2] = transmute_mut!(&mut ARRAY_OF_U8S);
20
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
+ |
22
+ = note: calls in constants are limited to constant functions, tuple structs and tuple variants
23
+ = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
24
+
16
25
  error[E0015]: cannot call non-const method `zerocopy::util::macro_util::Wrap::<&mut [u8; 2], &mut [u8; 2]>::transmute_mut` in constants
17
26
  --> tests/ui-nightly/transmute-mut-const.rs:18:37
18
27
  |
@@ -7,3 +7,13 @@ error[E0308]: mismatched types
7
7
  = note: expected type `usize`
8
8
  found mutable reference `&mut _`
9
9
  = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
10
+
11
+ error[E0308]: mismatched types
12
+ --> tests/ui-nightly/transmute-mut-dst-not-a-reference.rs:15:36
13
+ |
14
+ 15 | const DST_NOT_A_REFERENCE: usize = transmute_mut!(&mut 0u8);
15
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&mut _`
16
+ |
17
+ = note: expected type `usize`
18
+ found mutable reference `&mut _`
19
+ = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,8 +1,16 @@
1
- error[E0271]: type mismatch resolving `<[u8; 1] as KnownLayout>::PointerMetadata == usize`
2
- --> tests/ui-nightly/transmute-mut-src-unsized.rs:15:35
3
- |
4
- 15 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]);
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `()`
6
- |
7
- = note: required for `zerocopy::util::macro_util::Wrap<&mut [u8], &mut [u8; 1]>` to implement `zerocopy::util::macro_util::TransmuteMutDst<'_>`
8
- = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
1
+ error[E0599]: the method `transmute_mut` exists for struct `zerocopy::util::macro_util::Wrap<&mut [u8], &mut [u8; 1]>`, but its trait bounds were not satisfied
2
+ --> tests/ui-nightly/transmute-mut-src-unsized.rs:15:35
3
+ |
4
+ 15 | const SRC_UNSIZED: &mut [u8; 1] = transmute_mut!(&mut [0u8][..]);
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
+ |
7
+ ::: src/util/macro_util.rs
8
+ |
9
+ | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
10
+ | ------------------------- doesn't satisfy `_: TransmuteMutDst<'_>`
11
+ |
12
+ = note: the following trait bounds were not satisfied:
13
+ `[u8]: Sized`
14
+ `<[u8; 1] as KnownLayout>::PointerMetadata = usize`
15
+ which is required by `zerocopy::util::macro_util::Wrap<&mut [u8], &mut [u8; 1]>: zerocopy::util::macro_util::TransmuteMutDst<'_>`
16
+ = note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -27,3 +27,13 @@ error[E0308]: mismatched types
27
27
  = note: expected mutable reference `&mut u8`
28
28
  found reference `&_`
29
29
  = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
30
+
31
+ error[E0308]: mismatched types
32
+ --> tests/ui-nightly/transmute-ref-dst-mutable.rs:16:22
33
+ |
34
+ 16 | let _: &mut u8 = transmute_ref!(&0u8);
35
+ | ^^^^^^^^^^^^^^^^^^^^ types differ in mutability
36
+ |
37
+ = note: expected mutable reference `&mut u8`
38
+ found reference `&_`
39
+ = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -27,3 +27,13 @@ error[E0308]: mismatched types
27
27
  = note: expected type `usize`
28
28
  found reference `&_`
29
29
  = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
30
+
31
+ error[E0308]: mismatched types
32
+ --> tests/ui-nightly/transmute-ref-dst-not-a-reference.rs:15:36
33
+ |
34
+ 15 | const DST_NOT_A_REFERENCE: usize = transmute_ref!(&0u8);
35
+ | ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_`
36
+ |
37
+ = note: expected type `usize`
38
+ found reference `&_`
39
+ = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -43,3 +43,13 @@ error[E0308]: mismatched types
43
43
  = note: expected type `usize`
44
44
  found reference `&_`
45
45
  = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
46
+
47
+ error[E0308]: mismatched types
48
+ --> tests/ui-nightly/transmute-ref-src-dst-not-references.rs:15:39
49
+ |
50
+ 15 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize);
51
+ | ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_`
52
+ |
53
+ = note: expected type `usize`
54
+ found reference `&_`
55
+ = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,8 +1,16 @@
1
- error[E0271]: type mismatch resolving `<[u8; 1] as KnownLayout>::PointerMetadata == usize`
2
- --> tests/ui-nightly/transmute-ref-src-unsized.rs:14:31
3
- |
4
- 14 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]);
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `()`
6
- |
7
- = note: required for `zerocopy::util::macro_util::Wrap<&[u8], &[u8; 1]>` to implement `zerocopy::util::macro_util::TransmuteRefDst<'_>`
8
- = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
1
+ error[E0599]: the method `transmute_ref` exists for struct `zerocopy::util::macro_util::Wrap<&[u8], &[u8; 1]>`, but its trait bounds were not satisfied
2
+ --> tests/ui-nightly/transmute-ref-src-unsized.rs:14:31
3
+ |
4
+ 14 | const SRC_UNSIZED: &[u8; 1] = transmute_ref!(&[0u8][..]);
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
6
+ |
7
+ ::: src/util/macro_util.rs
8
+ |
9
+ | pub struct Wrap<Src, Dst>(pub Src, pub PhantomData<Dst>);
10
+ | ------------------------- doesn't satisfy `_: TransmuteRefDst<'_>`
11
+ |
12
+ = note: the following trait bounds were not satisfied:
13
+ `[u8]: Sized`
14
+ `<[u8; 1] as KnownLayout>::PointerMetadata = usize`
15
+ which is required by `zerocopy::util::macro_util::Wrap<&[u8], &[u8; 1]>: zerocopy::util::macro_util::TransmuteRefDst<'_>`
16
+ = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -1,31 +1,3 @@
1
- error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
2
- --> tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs:18:33
3
- |
4
- 18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src);
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
6
- |
7
- help: the trait `TryFromBytes` is not implemented for `NotZerocopy`
8
- --> tests/ui-nightly/../include.rs
9
- |
10
- 15 | pub struct NotZerocopy<T = ()>(pub T);
11
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
- = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy`
13
- = help: the following other types implement trait `TryFromBytes`:
14
- ()
15
- (A, B)
16
- (A, B, C)
17
- (A, B, C, D)
18
- (A, B, C, D, E)
19
- (A, B, C, D, E, F)
20
- (A, B, C, D, E, F, G)
21
- (A, B, C, D, E, F, G, H)
22
- and $N others
23
- note: required by a bound in `ValidityError`
24
- --> src/error.rs
25
- |
26
- | pub struct ValidityError<Src, Dst: ?Sized + TryFromBytes> {
27
- | ^^^^^^^^^^^^ required by this bound in `ValidityError`
28
-
29
1
  error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
30
2
  --> tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs:18:63
31
3
  |
@@ -48,14 +20,14 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy`
48
20
  (A, B, C, D, E, F, G)
49
21
  (A, B, C, D, E, F, G, H)
50
22
  and $N others
51
- note: required by a bound in `zerocopy::util::macro_util::try_transmute_mut`
23
+ note: required by a bound in `zerocopy::util::macro_util::Wrap::<&'a mut Src, &'a mut Dst>::try_transmute_mut`
52
24
  --> src/util/macro_util.rs
53
25
  |
54
- | pub fn try_transmute_mut<Src, Dst>(src: &mut Src) -> Result<&mut Dst, ValidityError<&mut Src, Dst>>
55
- | ----------------- required by a bound in this function
26
+ | pub fn try_transmute_mut(self) -> Result<&'a mut Dst, ValidityError<&'a mut Src, Dst>>
27
+ | ----------------- required by a bound in this associated function
56
28
  ...
57
- | Dst: TryFromBytes + IntoBytes,
58
- | ^^^^^^^^^^^^ required by this bound in `try_transmute_mut`
29
+ | Dst: TryFromBytes + IntoBytes,
30
+ | ^^^^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::try_transmute_mut`
59
31
  = note: this error originates in the macro `try_transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
60
32
 
61
33
  error[E0277]: the trait bound `NotZerocopy: IntoBytes` is not satisfied
@@ -80,16 +52,44 @@ help: the trait `IntoBytes` is not implemented for `NotZerocopy`
80
52
  AtomicI8
81
53
  AtomicIsize
82
54
  and $N others
83
- note: required by a bound in `zerocopy::util::macro_util::try_transmute_mut`
55
+ note: required by a bound in `zerocopy::util::macro_util::Wrap::<&'a mut Src, &'a mut Dst>::try_transmute_mut`
84
56
  --> src/util/macro_util.rs
85
57
  |
86
- | pub fn try_transmute_mut<Src, Dst>(src: &mut Src) -> Result<&mut Dst, ValidityError<&mut Src, Dst>>
87
- | ----------------- required by a bound in this function
58
+ | pub fn try_transmute_mut(self) -> Result<&'a mut Dst, ValidityError<&'a mut Src, Dst>>
59
+ | ----------------- required by a bound in this associated function
88
60
  ...
89
- | Dst: TryFromBytes + IntoBytes,
90
- | ^^^^^^^^^ required by this bound in `try_transmute_mut`
61
+ | Dst: TryFromBytes + IntoBytes,
62
+ | ^^^^^^^^^ required by this bound in `Wrap::<&mut Src, &mut Dst>::try_transmute_mut`
91
63
  = note: this error originates in the macro `try_transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
92
64
 
65
+ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
66
+ --> tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs:18:33
67
+ |
68
+ 18 | let dst_not_try_from_bytes: Result<&mut NotZerocopy, _> = try_transmute_mut!(src);
69
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
70
+ |
71
+ help: the trait `TryFromBytes` is not implemented for `NotZerocopy`
72
+ --> tests/ui-nightly/../include.rs
73
+ |
74
+ 15 | pub struct NotZerocopy<T = ()>(pub T);
75
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76
+ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy`
77
+ = help: the following other types implement trait `TryFromBytes`:
78
+ ()
79
+ (A, B)
80
+ (A, B, C)
81
+ (A, B, C, D)
82
+ (A, B, C, D, E)
83
+ (A, B, C, D, E, F)
84
+ (A, B, C, D, E, F, G)
85
+ (A, B, C, D, E, F, G, H)
86
+ and $N others
87
+ note: required by a bound in `ValidityError`
88
+ --> src/error.rs
89
+ |
90
+ | pub struct ValidityError<Src, Dst: ?Sized + TryFromBytes> {
91
+ | ^^^^^^^^^^^^ required by this bound in `ValidityError`
92
+
93
93
  error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
94
94
  --> tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs:18:63
95
95
  |
@@ -1,8 +1,8 @@
1
1
  error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
2
- --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:33
2
+ --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59
3
3
  |
4
4
  17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0));
5
- | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
6
6
  |
7
7
  help: the trait `TryFromBytes` is not implemented for `NotZerocopy`
8
8
  --> tests/ui-nightly/../include.rs
@@ -20,75 +20,75 @@ help: the trait `TryFromBytes` is not implemented for `NotZerocopy`
20
20
  (A, B, C, D, E, F, G)
21
21
  (A, B, C, D, E, F, G, H)
22
22
  and $N others
23
- note: required by a bound in `ValidityError`
24
- --> src/error.rs
23
+ note: required by a bound in `zerocopy::util::macro_util::Wrap::<&'a Src, &'a Dst>::try_transmute_ref`
24
+ --> src/util/macro_util.rs
25
25
  |
26
- | pub struct ValidityError<Src, Dst: ?Sized + TryFromBytes> {
27
- | ^^^^^^^^^^^^ required by this bound in `ValidityError`
26
+ | pub fn try_transmute_ref(self) -> Result<&'a Dst, ValidityError<&'a Src, Dst>>
27
+ | ----------------- required by a bound in this associated function
28
+ ...
29
+ | Dst: TryFromBytes + Immutable,
30
+ | ^^^^^^^^^^^^ required by this bound in `Wrap::<&Src, &Dst>::try_transmute_ref`
31
+ = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
28
32
 
29
- error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
33
+ error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied
30
34
  --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59
31
35
  |
32
36
  17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0));
33
37
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
34
38
  |
35
- help: the trait `TryFromBytes` is not implemented for `NotZerocopy`
39
+ help: the trait `Immutable` is not implemented for `NotZerocopy`
36
40
  --> tests/ui-nightly/../include.rs
37
41
  |
38
42
  15 | pub struct NotZerocopy<T = ()>(pub T);
39
43
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40
- = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy`
41
- = help: the following other types implement trait `TryFromBytes`:
44
+ = note: Consider adding `#[derive(Immutable)]` to `NotZerocopy`
45
+ = help: the following other types implement trait `Immutable`:
46
+ &T
47
+ &mut T
42
48
  ()
43
49
  (A, B)
44
50
  (A, B, C)
45
51
  (A, B, C, D)
46
52
  (A, B, C, D, E)
47
53
  (A, B, C, D, E, F)
48
- (A, B, C, D, E, F, G)
49
- (A, B, C, D, E, F, G, H)
50
54
  and $N others
51
- note: required by a bound in `zerocopy::util::macro_util::try_transmute_ref`
55
+ note: required by a bound in `zerocopy::util::macro_util::Wrap::<&'a Src, &'a Dst>::try_transmute_ref`
52
56
  --> src/util/macro_util.rs
53
57
  |
54
- | pub fn try_transmute_ref<Src, Dst>(src: &Src) -> Result<&Dst, ValidityError<&Src, Dst>>
55
- | ----------------- required by a bound in this function
58
+ | pub fn try_transmute_ref(self) -> Result<&'a Dst, ValidityError<&'a Src, Dst>>
59
+ | ----------------- required by a bound in this associated function
56
60
  ...
57
- | Dst: TryFromBytes + Immutable,
58
- | ^^^^^^^^^^^^ required by this bound in `try_transmute_ref`
61
+ | Dst: TryFromBytes + Immutable,
62
+ | ^^^^^^^^^ required by this bound in `Wrap::<&Src, &Dst>::try_transmute_ref`
59
63
  = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
60
64
 
61
- error[E0277]: the trait bound `NotZerocopy: Immutable` is not satisfied
62
- --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59
65
+ error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
66
+ --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:33
63
67
  |
64
68
  17 | let dst_not_try_from_bytes: Result<&NotZerocopy, _> = try_transmute_ref!(&AU16(0));
65
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
69
+ | ^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
66
70
  |
67
- help: the trait `Immutable` is not implemented for `NotZerocopy`
71
+ help: the trait `TryFromBytes` is not implemented for `NotZerocopy`
68
72
  --> tests/ui-nightly/../include.rs
69
73
  |
70
74
  15 | pub struct NotZerocopy<T = ()>(pub T);
71
75
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72
- = note: Consider adding `#[derive(Immutable)]` to `NotZerocopy`
73
- = help: the following other types implement trait `Immutable`:
74
- &T
75
- &mut T
76
+ = note: Consider adding `#[derive(TryFromBytes)]` to `NotZerocopy`
77
+ = help: the following other types implement trait `TryFromBytes`:
76
78
  ()
77
79
  (A, B)
78
80
  (A, B, C)
79
81
  (A, B, C, D)
80
82
  (A, B, C, D, E)
81
83
  (A, B, C, D, E, F)
84
+ (A, B, C, D, E, F, G)
85
+ (A, B, C, D, E, F, G, H)
82
86
  and $N others
83
- note: required by a bound in `zerocopy::util::macro_util::try_transmute_ref`
84
- --> src/util/macro_util.rs
87
+ note: required by a bound in `ValidityError`
88
+ --> src/error.rs
85
89
  |
86
- | pub fn try_transmute_ref<Src, Dst>(src: &Src) -> Result<&Dst, ValidityError<&Src, Dst>>
87
- | ----------------- required by a bound in this function
88
- ...
89
- | Dst: TryFromBytes + Immutable,
90
- | ^^^^^^^^^ required by this bound in `try_transmute_ref`
91
- = note: this error originates in the macro `try_transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
90
+ | pub struct ValidityError<Src, Dst: ?Sized + TryFromBytes> {
91
+ | ^^^^^^^^^^^^ required by this bound in `ValidityError`
92
92
 
93
93
  error[E0277]: the trait bound `NotZerocopy: TryFromBytes` is not satisfied
94
94
  --> tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs:17:59