]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized/unsized-fn-arg.stderr
Rollup merge of #103163 - SUPERCILEX:uninit-array-assume2, r=scottmcm
[rust.git] / src / test / ui / unsized / unsized-fn-arg.stderr
1 error[E0277]: the size for values of type `T` cannot be known at compilation time
2   --> $DIR/unsized-fn-arg.rs:5:17
3    |
4 LL | fn f<T: ?Sized>(t: T) {}
5    |      -          ^ doesn't have a size known at compile-time
6    |      |
7    |      this type parameter needs to be `std::marker::Sized`
8    |
9    = help: unsized fn params are gated as an unstable feature
10 help: consider removing the `?Sized` bound to make the type parameter `Sized`
11    |
12 LL - fn f<T: ?Sized>(t: T) {}
13 LL + fn f<T>(t: T) {}
14    |
15 help: function arguments must have a statically known size, borrowed types always have a known size
16    |
17 LL | fn f<T: ?Sized>(t: &T) {}
18    |                    +
19
20 error: aborting due to previous error
21
22 For more information about this error, try `rustc --explain E0277`.