]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized-locals/unsized-exprs.stderr
Point at `impl` and type defs introducing requirements on E0277
[rust.git] / src / test / ui / unsized-locals / unsized-exprs.stderr
1 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
2   --> $DIR/unsized-exprs.rs:22:26
3    |
4 LL |     udrop::<(i32, [u8])>((42, *foo()));
5    |                          ^^^^^^^^^^^^ doesn't have a size known at compile-time
6    |
7    = help: within `({integer}, [u8])`, the trait `Sized` is not implemented for `[u8]`
8    = note: required because it appears within the type `({integer}, [u8])`
9    = note: tuples must have a statically known size to be initialized
10
11 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
12   --> $DIR/unsized-exprs.rs:24:22
13    |
14 LL |     udrop::<A<[u8]>>(A { 0: *foo() });
15    |                      ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
16    |
17    = help: within `A<[u8]>`, the trait `Sized` is not implemented for `[u8]`
18 note: required because it appears within the type `A<[u8]>`
19   --> $DIR/unsized-exprs.rs:3:8
20    |
21 LL | struct A<X: ?Sized>(X);
22    |        ^
23    = note: structs must have a statically known size to be initialized
24
25 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
26   --> $DIR/unsized-exprs.rs:26:22
27    |
28 LL |     udrop::<A<[u8]>>(A(*foo()));
29    |                      ^ doesn't have a size known at compile-time
30    |
31    = help: within `A<[u8]>`, the trait `Sized` is not implemented for `[u8]`
32 note: required because it appears within the type `A<[u8]>`
33   --> $DIR/unsized-exprs.rs:3:8
34    |
35 LL | struct A<X: ?Sized>(X);
36    |        ^
37    = note: the return type of a function must have a statically known size
38
39 error: aborting due to 3 previous errors
40
41 For more information about this error, try `rustc --explain E0277`.