fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0308]: mismatched types 2 --> $DIR/suggest-box.rs:4:47 3 | 4LL | let _x: Box<dyn Fn() -> Result<(), ()>> = || { 5 | _____________-------------------------------___^ 6 | | | 7 | | expected due to this 8LL | | Err(())?; 9LL | | Ok(()) 10LL | | }; 11 | |_____^ expected `Box<dyn Fn() -> Result<(), ()>>`, found closure 12 | 13 = note: expected struct `Box<dyn Fn() -> Result<(), ()>>` 14 found closure `{closure@$DIR/suggest-box.rs:4:47: 4:49}` 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 16help: store this in the heap by calling `Box::new` 17 | 18LL ~ let _x: Box<dyn Fn() -> Result<(), ()>> = Box::new(|| { 19LL | Err(())?; 20LL | Ok(()) 21LL ~ }); 22 | 23 24error: aborting due to previous error 25 26For more information about this error, try `rustc --explain E0308`.