Compiler error of missing traits when using .into_boxed(), BoxedQuery, QueryDsl, and .count() #4374
Replies: 1 comment
-
Thanks for filling this. I've converted this to a discussion thread entry as this is not a bug report but a support question. Now the problem here is that your generic code is missing required trait bounds, so rustc cannot resolve the correct methods there. I personally do generally not provide complete solutions in such cases as that often lead to situations where people just copy code without understanding it, which in turn makes it harder to refactor that code later on (which in turn brings the same people here again asking me to update their code). Now the problem here is that this line
construct something of the type As for the specific error message: That one is not great, but there is not much we can do here until |
Beta Was this translation helpful? Give feedback.
-
Setup
Versions
Feature Flags
Problem Description
While creating a wrapper for serializing data contents & their totals, .count() statements (and their extending .select() statements) run a compile-time error for missing Table, AsQuery, Select for QueryDsl through the where clause.
What are you trying to accomplish?
I was looking into creating a wrapper to implement paginate responses. Thus using .into_boxed() for applying dynamic filters & sortings.
What is the expected output?
No Compiler error of missing traits.
Some common documentation I found about using the corresponding types say to use QueryDsl. Using said type does not cause errors on .into_boxed() or proceeding with .filter() but does with .select() or .count().
For example, SelectDsl:
What is the actual output?
Compiler error stating missing traits:
Steps to reproduce
main.rs
Checklist
closed if this is not the case)
Beta Was this translation helpful? Give feedback.
All reactions