File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -586,6 +586,12 @@ where
586586}
587587
588588/// Trait for plucking out a `Field` from a type by type-level `TargetKey`.
589+ #[ diagnostic:: on_unimplemented(
590+ message = "Cannot find field with key `{TargetKey}` in `{Self}`" ,
591+ label = "Field not found" ,
592+ note = "The source type does not contain a field with the target key." ,
593+ note = "Make sure the field name exists in the source struct and matches exactly."
594+ ) ]
589595pub trait ByNameFieldPlucker < TargetKey , Index > {
590596 type TargetValue ;
591597 type Remainder ;
@@ -752,6 +758,13 @@ where
752758///
753759/// Credit:
754760/// 1. Haskell "transmogrify" Github repo: <https://github.com/ivan-m/transmogrify>
761+ #[ diagnostic:: on_unimplemented(
762+ message = "Cannot transmogrify `{Self}` into `{Target}`" ,
763+ label = "Cannot convert this type into the target type" ,
764+ note = "Transmogrify requires that the source and target types have compatible structures." ,
765+ note = "The source type must have all the fields needed for the target type, possibly in a different order or nested structure." ,
766+ note = "Check that field names match and types are compatible between the source and target."
767+ ) ]
755768pub trait Transmogrifier < Target , TransmogrifyIndexIndices > {
756769 /// Consume this current object and return an object of the Target type.
757770 ///
You can’t perform that action at this time.
0 commit comments