summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2026-09-23 19:20:17 +0100
committerGary Guo <gary@garyguo.net>2026-09-25 21:38:44 +0100
commit6f78441c58c1012324da3189ea650cfeeb98966c (patch)
tree3a7310714380955a7e1b00413a651e6fd2784889 /tools/lib/python
parentc5155147cdf0053694f8bcdfcc616d254ae6842e (diff)
downloadlinux-next-6f78441c58c1012324da3189ea650cfeeb98966c.tar.gz
linux-next-6f78441c58c1012324da3189ea650cfeeb98966c.zip
rust: pin-init: internal: add custom diagnostic when `#[pin_data]` is not implemented
Produce a more helpful error message when `#[pin_data]` is omitted. The error message changes from error[E0277]: the trait bound `Foo: pin_init::__internal::HasPinData` is not satisfied --> tests/ui/compile-fail/init/missing_pin_data.rs:9:19 | 9 | pin_init!(Self { a: 42 }) | ^^^^ unsatisfied trait bound | help: the trait `pin_init::__internal::HasPinData` is not implemented for `Foo` --> tests/ui/compile-fail/init/missing_pin_data.rs:3:1 | 3 | struct Foo { | ^^^^^^^^^^ to error[E0277]: `Foo` cannot be used with `pin_init!` macro --> tests/ui/compile-fail/init/missing_pin_data.rs:9:19 | 9 | pin_init!(Self { a: 42 }) | ^^^^ unsatisfied trait bound | help: the trait `pin_init::__internal::HasPinData` is not implemented for `Foo` --> tests/ui/compile-fail/init/missing_pin_data.rs:3:1 | 3 | struct Foo { | ^^^^^^^^^^ = note: did you forget to add `#[pin_data]` attribute to the struct? Link: https://patch.msgid.link/20260923-dev-pin-data-diag-v1-4-e4d7193569e5@garyguo.net Signed-off-by: Gary Guo <gary@garyguo.net>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions