Skip to content

Better user-facing compile-time errors using #[diagnostic] #13204

Closed as not planned
@Adamkob12

Description

@Adamkob12

What problem does this solve or what need does it fill?

Currently, due to the heavy use of all_tuples (Bundling up generic types in tuples) in traits like Bundle, SystemParam, IntoSystemConfig, user-facing compile time errors can get very messy and uninformative.

For example (the actual problem was caused when forgetting to implement Component for some type):

Screenshot from 2024-05-03 09-18-42

But it's gonna be very hard for inexperienced users to understand what the problem is, and how to fix it.

What solution would you like?

Version 1.78 introduced #[diagnostic] attributes. We can use #[diagnostic::on_unimplemented] to make those errors more informative and readable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useS-DuplicateThis issue or PR already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions