1 fn foo1(s: &str) -> impl Iterator<Item = String> + '_ {
3 .flat_map(move |()| s.chars().map(|c| format!("{}{}", c, s)))
4 //~^ ERROR captured variable cannot escape `FnMut` closure body
5 //~| HELP consider adding 'move' keyword before the nested closure
8 fn foo2(s: &str) -> impl Sized + '_ {
9 move |()| s.chars().map(|c| format!("{}{}", c, s))
10 //~^ ERROR lifetime may not live long enough
11 //~| HELP consider adding 'move' keyword before the nested closure