Skip to content

[Tracking Issue]: Leverage Rust diagnostics attributes to improve "type-checking" related error messages #2723

@davidsemakula

Description

@davidsemakula

Use Rust's #[diagnostic::on_unimplemented(...)] and #[diagnostic::do_not_recommend] attributes to improve diagnostics messages for ink!'s "internal" "type-checking" abstractions

  • Use the diagnostic attributes on "internal" traits that are only used for "type-checking" where an error telling the user about a missing trait implementation is not very useful
    • ConstructorOutput
    • ConstructorReturnType
    • ...
  • Convert some type-checking "guards" that are currently struct-based into trait-based ones to improve their error messages in a similar way
    • DispatchInput
    • DispatchOutput
    • DispatchInputSol
    • DispatchOutputSol
    • ...

See #2722 for an example of leveraging these attributes to improve diagnostics messages

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions