]> git.proxmox.com Git - rustc.git/blame - tests/ui/unsized/unsized-enum.stderr
New upstream version 1.76.0+dfsg1
[rustc.git] / tests / ui / unsized / unsized-enum.stderr
CommitLineData
8faf50e0 1error[E0277]: the size for values of type `T` cannot be known at compilation time
0731742a 2 --> $DIR/unsized-enum.rs:6:36
8faf50e0 3 |
b7449926 4LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
74b04a01 5 | - ^^^^^^ doesn't have a size known at compile-time
e74abb32 6 | |
fe692bf9 7 | this type parameter needs to be `Sized`
8faf50e0 8 |
94222f64
XL
9note: required by a bound in `Foo`
10 --> $DIR/unsized-enum.rs:4:10
11 |
12LL | enum Foo<U> { FooSome(U), FooNone }
13 | ^ required by this bound in `Foo`
f035d41b
XL
14help: you could relax the implicit `Sized` bound on `U` if it were used through indirection like `&U` or `Box<U>`
15 --> $DIR/unsized-enum.rs:4:10
16 |
17LL | enum Foo<U> { FooSome(U), FooNone }
6a06907d 18 | ^ - ...if indirection were used here: `Box<U>`
f035d41b
XL
19 | |
20 | this could be changed to `U: ?Sized`...
94222f64
XL
21help: consider removing the `?Sized` bound to make the type parameter `Sized`
22 |
23LL - fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
24LL + fn foo2<T>() { not_sized::<Foo<T>>() }
923072b8 25 |
8faf50e0 26
4b012472 27error: aborting due to 1 previous error
8faf50e0
XL
28
29For more information about this error, try `rustc --explain E0277`.