2022-07-11 00:20:37 -05:00
|
|
|
error[E0277]: the size for values of type `dyn ToString` cannot be known at compilation time
|
|
|
|
--> $DIR/issue-61525.rs:14:33
|
|
|
|
|
|
|
|
|
LL | 1.query::<dyn ToString>("")
|
|
|
|
| ----- ^^ doesn't have a size known at compile-time
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
|
|
|
|
|
|
|
|
= help: the trait `Sized` is not implemented for `dyn ToString`
|
|
|
|
note: required by a bound in `Example::query`
|
|
|
|
--> $DIR/issue-61525.rs:2:14
|
|
|
|
|
|
|
|
|
LL | fn query<Q>(self, q: Q);
|
|
|
|
| ^ required by this bound in `Example::query`
|
|
|
|
help: consider relaxing the implicit `Sized` restriction
|
|
|
|
|
|
|
|
|
LL | fn query<Q: ?Sized>(self, q: Q);
|
|
|
|
| ++++++++
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/issue-61525.rs:14:33
|
|
|
|
|
|
|
|
|
LL | 1.query::<dyn ToString>("")
|
|
|
|
| --------------------- ^^ expected trait object `dyn ToString`, found `&str`
|
|
|
|
| |
|
2023-01-04 21:02:10 -06:00
|
|
|
| arguments to this method are incorrect
|
2022-07-11 00:20:37 -05:00
|
|
|
|
|
|
|
|
= note: expected trait object `dyn ToString`
|
|
|
|
found reference `&'static str`
|
|
|
|
note: associated function defined here
|
|
|
|
--> $DIR/issue-61525.rs:2:8
|
|
|
|
|
|
|
|
|
LL | fn query<Q>(self, q: Q);
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
Some errors have detailed explanations: E0277, E0308.
|
|
|
|
For more information about an error, try `rustc --explain E0277`.
|