fork/rust

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

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
1.4 KiB28 linesraw
1error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
2  --> $DIR/issue-5883.rs:7:15
3   |
4LL | fn new_struct(r: dyn A + 'static)
5   |               ^ doesn't have a size known at compile-time
6   |
7   = help: the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)`
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: all local variables must have a statically known size
10   = help: unsized locals are gated as an unstable feature
11
12error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
13  --> $DIR/issue-5883.rs:8:8
14   |
15LL |     -> Struct {
16   |        ^^^^^^ doesn't have a size known at compile-time
17LL |
18LL |     Struct { r: r }
19   |     --------------- this returned value is of type `Struct`
20   |
21   = help: within `Struct`, the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)`
22   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
23   = note: required because it appears within the type `Struct`
24   = note: the return type of a function must have a statically known size
25
26error: aborting due to 2 previous errors
27
28For more information about this error, try `rustc --explain E0277`.