1 error[E0308]: mismatched types
2 --> $DIR/suggest-box.rs:4:47
4 LL | let _x: Box<dyn Fn() -> Result<(), ()>> = || {
5 | _____________-------------------------------___^
7 | | expected due to this
11 | |_____^ expected struct `Box`, found closure
13 = note: expected struct `Box<dyn Fn() -> Result<(), ()>>`
14 found closure `[closure@$DIR/suggest-box.rs:4:47: 7:6]`
15 = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
16 help: store this in the heap by calling `Box::new`
18 LL ~ let _x: Box<dyn Fn() -> Result<(), ()>> = Box::new(|| {
24 error: aborting due to previous error
26 For more information about this error, try `rustc --explain E0308`.