Closed
Description
fn main() {
let _: Vec<i32> = None.unwrap_or(vec![]);
}
gives
warning: use of `unwrap_or` followed by a function call
--> src/main.rs:2:23
|
2 | let _: Vec<i32> = None.unwrap_or(vec![]);
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(or_fun_call)] on by default
help: try this
| let _: Vec<i32> = None.unwrap_or_else(|| < [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ));
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#or_fun_call
The suggestion looks like half expanded macro. It does not compile.