diff --git a/rust/pin-init/src/__internal.rs b/rust/pin-init/src/__internal.rs index 914c4d1a06eb..cba53b8c3c94 100644 --- a/rust/pin-init/src/__internal.rs +++ b/rust/pin-init/src/__internal.rs @@ -67,6 +67,10 @@ pub unsafe fn new() -> Self { /// /// `pin-init` relies on the correctness of the helper functions defined on `PinData`. /// Thus, only the `#[pin_data]` can implement this trait. +#[diagnostic::on_unimplemented( + message = "`{Self}` cannot be used with `pin_init!` macro", + note = "did you forget to add `#[pin_data]` attribute to the struct?" +)] pub unsafe trait HasPinData { type PinData;