]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-24446.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-24446.stderr
1 error[E0308]: mismatched types
2   --> $DIR/issue-24446.rs:12:31
3    |
4 LL |       static foo: Fn() -> u32 = || -> u32 {
5    |  _______________________________^
6 LL | |         //~^ ERROR mismatched types
7 LL | |         //~| ERROR the size for values of type
8 LL | |         0
9 LL | |     };
10    | |_____^ expected trait std::ops::Fn, found closure
11    |
12    = note: expected type `(dyn std::ops::Fn() -> u32 + 'static)`
13               found type `[closure@$DIR/issue-24446.rs:12:31: 16:6]`
14
15 error[E0277]: the size for values of type `(dyn std::ops::Fn() -> u32 + 'static)` cannot be known at compilation time
16   --> $DIR/issue-24446.rs:12:31
17    |
18 LL |       static foo: Fn() -> u32 = || -> u32 {
19    |  _______________________________^
20 LL | |         //~^ ERROR mismatched types
21 LL | |         //~| ERROR the size for values of type
22 LL | |         0
23 LL | |     };
24    | |_____^ doesn't have a size known at compile-time
25    |
26    = help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::Fn() -> u32 + 'static)`
27    = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
28    = note: constant expressions must have a statically known size
29
30 error: aborting due to 2 previous errors
31
32 Some errors occurred: E0277, E0308.
33 For more information about an error, try `rustc --explain E0277`.