]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-42312.stderr
Rollup merge of #105780 - GuillaumeGomez:read-more-links, r=notriddle
[rust.git] / src / test / ui / issues / issue-42312.stderr
1 error[E0277]: the size for values of type `<Self as Deref>::Target` cannot be known at compilation time
2   --> $DIR/issue-42312.rs:4:12
3    |
4 LL |     fn baz(_: Self::Target) where Self: Deref {}
5    |            ^ doesn't have a size known at compile-time
6    |
7    = help: the trait `Sized` is not implemented for `<Self as Deref>::Target`
8    = help: unsized fn params are gated as an unstable feature
9 help: consider further restricting the associated type
10    |
11 LL |     fn baz(_: Self::Target) where Self: Deref, <Self as Deref>::Target: Sized {}
12    |                                              ++++++++++++++++++++++++++++++++
13 help: function arguments must have a statically known size, borrowed types always have a known size
14    |
15 LL |     fn baz(_: &Self::Target) where Self: Deref {}
16    |               +
17
18 error[E0277]: the size for values of type `(dyn ToString + 'static)` cannot be known at compilation time
19   --> $DIR/issue-42312.rs:8:10
20    |
21 LL | pub fn f(_: dyn ToString) {}
22    |          ^ doesn't have a size known at compile-time
23    |
24    = help: the trait `Sized` is not implemented for `(dyn ToString + 'static)`
25    = help: unsized fn params are gated as an unstable feature
26 help: you can use `impl Trait` as the argument type
27    |
28 LL | pub fn f(_: impl ToString) {}
29    |             ~~~~
30 help: function arguments must have a statically known size, borrowed types always have a known size
31    |
32 LL | pub fn f(_: &dyn ToString) {}
33    |             +
34
35 error: aborting due to 2 previous errors
36
37 For more information about this error, try `rustc --explain E0277`.