]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized-locals/unsized-exprs.stderr
Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726
[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    |     required by a bound introduced by this call
18    |
19    = help: the trait `Sized` is not implemented for `[u8]`
20 note: required because it appears within the type `A<[u8]>`
21   --> $DIR/unsized-exprs.rs:3:8
22    |
23 LL | struct A<X: ?Sized>(X);
24    |        ^
25    = note: structs must have a statically known size to be initialized
26
27 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
28   --> $DIR/unsized-exprs.rs:26:22
29    |
30 LL |     udrop::<A<[u8]>>(A(*foo()));
31    |                      ^ doesn't have a size known at compile-time
32    |
33    = help: within `A<[u8]>`, the trait `Sized` is not implemented for `[u8]`
34 note: required because it appears within the type `A<[u8]>`
35   --> $DIR/unsized-exprs.rs:3:8
36    |
37 LL | struct A<X: ?Sized>(X);
38    |        ^
39    = note: the return type of a function must have a statically known size
40
41 error: aborting due to 3 previous errors
42
43 For more information about this error, try `rustc --explain E0277`.