]> git.lizzy.rs Git - rust.git/blob - src/test/ui/methods/issues/issue-61525.stderr
move an `assert!` to the right place
[rust.git] / src / test / ui / methods / issues / issue-61525.stderr
1 error[E0277]: the size for values of type `dyn ToString` cannot be known at compilation time
2   --> $DIR/issue-61525.rs:14:33
3    |
4 LL |         1.query::<dyn ToString>("")
5    |           -----                 ^^ doesn't have a size known at compile-time
6    |           |
7    |           required by a bound introduced by this call
8    |
9    = help: the trait `Sized` is not implemented for `dyn ToString`
10 note: required by a bound in `Example::query`
11   --> $DIR/issue-61525.rs:2:14
12    |
13 LL |     fn query<Q>(self, q: Q);
14    |              ^ required by this bound in `Example::query`
15 help: consider relaxing the implicit `Sized` restriction
16    |
17 LL |     fn query<Q: ?Sized>(self, q: Q);
18    |               ++++++++
19
20 error[E0308]: mismatched types
21   --> $DIR/issue-61525.rs:14:33
22    |
23 LL |         1.query::<dyn ToString>("")
24    |           --------------------- ^^ expected trait object `dyn ToString`, found `&str`
25    |           |
26    |           arguments to this function are incorrect
27    |
28    = note: expected trait object `dyn ToString`
29                  found reference `&'static str`
30 note: associated function defined here
31   --> $DIR/issue-61525.rs:2:8
32    |
33 LL |     fn query<Q>(self, q: Q);
34    |        ^^^^^
35
36 error: aborting due to 2 previous errors
37
38 Some errors have detailed explanations: E0277, E0308.
39 For more information about an error, try `rustc --explain E0277`.