Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CompatibleType not implemented error message #4472

Merged
merged 3 commits into from
Feb 8, 2025

Conversation

Ten0
Copy link
Member

@Ten0 Ten0 commented Feb 7, 2025

I was told "OK I see this error message but my struct already implements Selectable so that's not useful".

As it turns out, this message would sometimes be misunderstood as the check_for_backend part only relating to the QueryableByName usage, but not to the Selectable usage, whereas check_for_backend is in fact the key point.

Hopefully this new writing will avoid this. :)

I was told "OK I see this error message but my struct already implements Selectable so that's not useful".

As it turns out, this message would sometimes be misunderstood as the `check_for_backend` part only relating to the `QueryableByName` usage, but not to the `Selectable` usage, whereas that is in fact the key point.

Hopefully this new writing will avoid this. :)
@Ten0 Ten0 marked this pull request as ready for review February 7, 2025 16:59
@Ten0 Ten0 requested a review from a team February 7, 2025 16:59
@Ten0 Ten0 changed the title Improve CompatibleType diagnostic notes Improve CompatibleType error message Feb 7, 2025
@Ten0 Ten0 changed the title Improve CompatibleType error message Improve CompatibleType not implemented error message Feb 7, 2025
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍

Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me beside the missing ` to indicate that this is rust code. It just looks strange to use them only partially.

That written: Ideally I would find the time to implement the other part of the on_unimplemented attribute, which would allow us to add conditions to that attribute to only apply in certain situations. That would enable us to only talk about Selectable or QueryableByName if they are relevant. Maybe someday…

Ten0 and others added 2 commits February 8, 2025 22:37
@Ten0 Ten0 force-pushed the improve_compatibletype_error_message branch from 8d895fe to 0813d76 Compare February 8, 2025 21:37
@Ten0 Ten0 enabled auto-merge February 8, 2025 21:38
@Ten0 Ten0 added this pull request to the merge queue Feb 8, 2025
Merged via the queue into diesel-rs:master with commit 0813d76 Feb 8, 2025
62 checks passed
@weiznich weiznich added the maybe backport Maybe backport this pr to the latest diesel release label Feb 9, 2025
@Ten0 Ten0 deleted the improve_compatibletype_error_message branch February 9, 2025 23:39
weiznich added a commit to weiznich/diesel that referenced this pull request Feb 14, 2025
This commit prepares a 2.2.8 release that includes the following
changes:

* diesel-rs#4472
* diesel-rs#4484
* diesel-rs#4486
* diesel-rs#4480
weiznich added a commit to weiznich/diesel that referenced this pull request Feb 14, 2025
This commit prepares a 2.2.8 release that includes the following
changes:

* diesel-rs#4472
* diesel-rs#4484
* diesel-rs#4486
* diesel-rs#4480
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maybe backport Maybe backport this pr to the latest diesel release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants