Closed
Description
The following (maybe incorrect) error message is given by the compiler:
71 | trait ColumnValue: for<'r> sqlx::Encode<'r, Postgres> + sqlx::Type<Postgres> {
| ----------- this trait cannot be made into an object...
= help: consider turning `type_info` into a method by giving it a `&self` argument or constraining it so it does not apply to trait objects
= help: consider turning `compatible` into a method by giving it a `&self` argument or constraining it so it does not apply to trait objects
help: consider turning `type_info` into a method by giving it a `&self` argument
|
175 | fn type_info&self() -> DB::TypeInfo;
| +++++ <======== (************ LOOK HERE ************)
help: consider turning `compatible` into a method by giving it a `&self` argument
|
184 | fn compatible&self, (ty: &DB::TypeInfo) -> bool {
| ++++++
when compiling the code:
trait ColumnValue: for<'r> sqlx::Encode<'r, sqlx::Postgres> + sqlx::Type<sqlx::Postgres> {
}
Shouldn't the message labeled "LOOK HERE" be fn type_info(&self) -> DB::TypeInfo;
?
$ cargo --version
cargo 1.57.0 (b2e52d7ca 2021-10-21)
$ rustc --version
rustc 1.57.0 (f1edd0429 2021-11-29)