fb2511c3c5
When encountering a boxed value as expected and a stack allocated value that could be boxed to fulfill the expectation, like in the following snippet, suggest `Box::new` wrapping.
9 lines
158 B
Rust
9 lines
158 B
Rust
// run-rustfix
|
|
|
|
fn main() {
|
|
let _x: Box<dyn Fn() -> Result<(), ()>> = Box::new(|| { //~ ERROR mismatched types
|
|
Err(())?;
|
|
Ok(())
|
|
});
|
|
}
|