]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized-locals/unsized-exprs.stderr
Rollup merge of #61207 - taiki-e:arbitrary_self_types-lifetime-elision-2, r=Centril
[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 `std::marker::Sized` is not implemented for `[u8]`
8    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
9    = note: required because it appears within the type `({integer}, [u8])`
10    = note: tuples must have a statically known size to be initialized
11
12 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
13   --> $DIR/unsized-exprs.rs:24:22
14    |
15 LL |     udrop::<A<[u8]>>(A { 0: *foo() });
16    |                      ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
17    |
18    = help: within `A<[u8]>`, the trait `std::marker::Sized` is not implemented for `[u8]`
19    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
20    = note: required because it appears within the type `A<[u8]>`
21    = note: structs must have a statically known size to be initialized
22
23 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
24   --> $DIR/unsized-exprs.rs:26:22
25    |
26 LL |     udrop::<A<[u8]>>(A(*foo()));
27    |                      ^ doesn't have a size known at compile-time
28    |
29    = help: within `A<[u8]>`, the trait `std::marker::Sized` is not implemented for `[u8]`
30    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
31    = note: required because it appears within the type `A<[u8]>`
32    = note: the return type of a function must have a statically known size
33
34 error: aborting due to 3 previous errors
35
36 For more information about this error, try `rustc --explain E0277`.