@@ -6,12 +6,15 @@ LL | fn baz(_: Self::Target) where Self: Deref {}
6
6
|
7
7
= help: the trait `std::marker::Sized` is not implemented for `<Self as std::ops::Deref>::Target`
8
8
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
9
- = note: all function arguments must have a statically known size
10
9
= help: unsized locals are gated as an unstable feature
11
10
help: consider further restricting the associated type
12
11
|
13
12
LL | fn baz(_: Self::Target) where Self: Deref, <Self as std::ops::Deref>::Target: std::marker::Sized {}
14
13
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
+ help: function arguments must have a statically known size, borrowed types always have a known size
15
+ |
16
+ LL | fn baz(_: &Self::Target) where Self: Deref {}
17
+ | ^
15
18
16
19
error[E0277]: the size for values of type `(dyn std::string::ToString + 'static)` cannot be known at compilation time
17
20
--> $DIR/issue-42312.rs:8:10
@@ -21,8 +24,11 @@ LL | pub fn f(_: dyn ToString) {}
21
24
|
22
25
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::string::ToString + 'static)`
23
26
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
24
- = note: all function arguments must have a statically known size
25
27
= help: unsized locals are gated as an unstable feature
28
+ help: function arguments must have a statically known size, borrowed types always have a known size
29
+ |
30
+ LL | pub fn f(_: &dyn ToString) {}
31
+ | ^
26
32
27
33
error: aborting due to 2 previous errors
28
34
0 commit comments