puns 0.1.5

Type punning proven at compile time: a safe alternative to transmute and to hand-written parsing of bytes
Documentation
error[E0080]: evaluation panicked: a self-relative pointer is its offset
  --> tests/compile-fail/pointer_not_its_offset.rs:22:1
   |
22 | puns::self_relative!(impl[T: Pun] Wide<T>);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `<Wide<u8> as puns::Pun>::LAYOUT` failed inside this call
   |
note: inside `puns::layout::Layout::pointer::<Wide<u8>, u8>`
  --> $RUST/core/src/panic.rs
   |
   = note: the failure occurred here
   |
  ::: src/layout.rs
   |
   |     assert!(size_of::<P>() == pointer.width, "a self-relative pointer is its offset");
   |     --------------------------------------------------------------------------------- in this macro invocation

note: erroneous constant encountered
 --> src/lib.rs
  |
  |   const ANALYSIS: Analysis = analyze(&S::LAYOUT, &D::LAYOUT);
  |                                       ^^^^^^^^^

note: erroneous constant encountered
 --> src/lib.rs
  |
  |     check(&Self::ANALYSIS, need)
  |            ^^^^^^^^^^^^^^

note: erroneous constant encountered
 --> src/lib.rs
  |
  |   const { Plan::<S, D>::VIEW };
  |           ^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
 --> src/lib.rs
  |
  |   const { Plan::<S, D>::VIEW };
  |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: the above error was encountered while instantiating `fn view_ref::<Wide<u8>, Wide<u8>>`
  --> tests/compile-fail/pointer_not_its_offset.rs:25:3
   |
25 |   puns::view_ref(wide)
   |   ^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
 --> src/deep.rs
  |
  |   let (a, b) = (A::LAYOUT, B::LAYOUT);
  |                 ^^^^^^^^^

note: erroneous constant encountered
 --> src/deep.rs
  |
  |   const { require(local::<S, D>(0)) };
  |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
 --> src/deep.rs
  |
  |   if const { B::LAYOUT.has_pointers() } {
  |              ^^^^^^^^^

note: erroneous constant encountered
 --> src/deep.rs
  |
  |   if const { B::LAYOUT.has_pointers() } {
  |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
 --> src/lib.rs
  |
  |       let (source, target) = (S::LAYOUT, D::LAYOUT);
  |                               ^^^^^^^^^

note: erroneous constant encountered
 --> src/lib.rs
  |
  |       let (head, stride, exact) = const {
  |  _________________________________^
  | |       // The slice length of the target is `head + len * stride`, exactly or rounded down.
  | |       let (source, target) = (S::LAYOUT, D::LAYOUT);
  | |       match (target.stride(), Self::ANALYSIS.fit.exact) {
... |
  | |     };
  | |_____^

note: erroneous constant encountered
 --> src/lib.rs
  |
  |       let (layout, target) = const { (S::LAYOUT, D::LAYOUT) };
  |                                       ^^^^^^^^^

note: erroneous constant encountered
 --> src/lib.rs
  |
  |       let (layout, target) = const { (S::LAYOUT, D::LAYOUT) };
  |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
 --> src/ptr.rs
  |
  |   if const { !T::LAYOUT.unsized_ } {
  |               ^^^^^^^^^

note: erroneous constant encountered
 --> src/ptr.rs
  |
  |   if const { !T::LAYOUT.unsized_ } {
  |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: erroneous constant encountered
 --> src/ptr.rs
  |
  |   if const { T::LAYOUT.unsized_ } {
  |              ^^^^^^^^^

note: erroneous constant encountered
 --> src/ptr.rs
  |
  |   if const { T::LAYOUT.unsized_ } {
  |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^