error[E0080]: evaluation panicked:
cannot pun: the source or the target holds a self-relative pointer, which a `&mut` would let safe code overwrite, swap or move: a pointer is only read.
Edit the value where it is, with what the crate that declares the pointer gives.
--> src/lib.rs
|
| const TAIL_MUT: () = Self::require(Self::check_tail_mut());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `puns::Plan::<Node, [u8; 4]>::TAIL_MUT` failed inside this call
|
note: inside `puns::Plan::<Node, [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>::TAIL_MUT };
| ^^^^^^^^^^^^^^^^^^^^^^
note: erroneous constant encountered
--> src/lib.rs
|
| const { Plan::<S, D>::TAIL_MUT };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: the above error was encountered while instantiating `fn tail_mut::<Node, [u8; 4]>`
--> tests/compile-fail/tail_mut_pointer.rs:15:3
|
15 | puns::tail_mut(node)
| ^^^^^^^^^^^^^^^^^^^^