fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.1 KiB29 linesraw
1error[E0277]: the size for values of type `T` cannot be known at compilation time
2  --> $DIR/unsized-enum.rs:6:36
3   |
4LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
5   |         -                          ^^^^^^ doesn't have a size known at compile-time
6   |         |
7   |         this type parameter needs to be `Sized`
8   |
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`
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 }
18   |          ^            - ...if indirection were used here: `Box<U>`
19   |          |
20   |          this could be changed to `U: ?Sized`...
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>>() }
25   |
26
27error: aborting due to previous error
28
29For more information about this error, try `rustc --explain E0277`.