]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized/unsized-bare-typaram.stderr
Auto merge of #106458 - albertlarsan68:move-tests, r=jyn514
[rust.git] / tests / ui / unsized / unsized-bare-typaram.stderr
1 error[E0277]: the size for values of type `T` cannot be known at compilation time
2   --> $DIR/unsized-bare-typaram.rs:2:29
3    |
4 LL | fn foo<T: ?Sized>() { bar::<T>() }
5    |        -                    ^ doesn't have a size known at compile-time
6    |        |
7    |        this type parameter needs to be `std::marker::Sized`
8    |
9 note: required by a bound in `bar`
10   --> $DIR/unsized-bare-typaram.rs:1:8
11    |
12 LL | fn bar<T: Sized>() { }
13    |        ^ required by this bound in `bar`
14 help: consider removing the `?Sized` bound to make the type parameter `Sized`
15    |
16 LL - fn foo<T: ?Sized>() { bar::<T>() }
17 LL + fn foo<T>() { bar::<T>() }
18    |
19
20 error: aborting due to previous error
21
22 For more information about this error, try `rustc --explain E0277`.