error[E0080]: evaluation panicked:
cannot pun: the target holds a self-relative pointer, and what a pointer aims at is not a property of its bytes.
Use `view_ref` to read a value that holds pointers as another type (it proves what they aim at).
--> src/lib.rs
|
| const BY_REF: () = Self::require(Self::check(Need::REF));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `puns::Plan::<relative::One<u32>, relative::One<[u8; 4]>>::BY_REF` failed inside this call
|
note: inside `puns::Plan::<relative::One<u32>, relative::One<[u8; 4]>>::require`
--> src/lib.rs
|
| message.panic();
| ^^^^^^^^^^^^^^^
note: inside `puns::Message::panic`
--> $RUST/core/src/panic.rs
|
= note: the failure occurred here
|
::: src/lib.rs
|
| panic!("{}", unsafe { core::str::from_utf8_unchecked(this.bytes.split_at(this.len).0) })
| ---------------------------------------------------------------------------------------- in this macro invocation
note: erroneous constant encountered
--> src/lib.rs
|
| const { Plan::<S, D>::BY_REF };
| ^^^^^^^^^^^^^^^^^^^^
note: erroneous constant encountered
--> src/lib.rs
|
| const { Plan::<S, D>::BY_REF };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: the above error was encountered while instantiating `fn pun_ref::<relative::One<u32>, relative::One<[u8; 4]>>`
--> tests/compile-fail/pun_ref_pointer_to_pointer.rs:9:3
|
9 | puns::pun_ref(pointer)
| ^^^^^^^^^^^^^^^^^^^^^^