]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized/unsized-fn-arg.stderr
Auto merge of #106711 - albertlarsan68:use-ci-llvm-when-lld, r=jyn514
[rust.git] / tests / 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`.